It works for me if I add no = Me after the first no.Initialize and if the OBJC code for deviceName is added at the end.
B4X:
Dim no As NativeObject = Me
Log(no.RunMethod("deviceName", Null).AsString)
Log(no.Initialize("NSLocale").RunMethod("preferredLanguages", Null).RunMethod("objectAtIndex:", Array(0)).AsString)
no = Me
Log(no.RunMethod("deviceName", Null).AsString)
Log(no.Initialize("NSBundle").RunMethod("mainBundle", Null).RunMethod("objectForInfoDictionaryKey:", Array("CFBundleDisplayName")).AsString)
B4X:
Application_Start
iPhone 8 Plus (GSM)
de-DE
iPhone 8 Plus (GSM)
B4i Example
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
Application_Active
Private Sub Button1_Click
Dim no As NativeObject = Me
Log(no.RunMethod("deviceName", Null).AsString)
Log(no.Initialize("NSLocale").RunMethod("preferredLanguages", Null).RunMethod("objectAtIndex:", Array(0)).AsString)
no = Me
Log(no.RunMethod("deviceName", Null).AsString)
Log(no.Initialize("NSBundle").RunMethod("mainBundle", Null).RunMethod("objectForInfoDictionaryKey:", Array("CFBundleDisplayName")).AsString)
End Sub