iOS Tutorial Quick Inline Objective-C Question

Just a quick question about inline Objective-C: Can I declare a variable outside of a method? This seems like a really basic question but I haven't use inline objective-c before and wanted to be sure before proceeding.

Example:
B4X:
UIStackView *stackView =[[UIStackView alloc] init]; //This is outside the scope of methods.

- (void) myMehtod{

}
 
Last edited:

LWGShane

Well-Known Member
Licensed User
Longtime User

I've got it working... However, it's not aligned properly and it randomly (?) tells me that the Orientation property is nil which it really isn't.

I might do a test and create the StackView via NativeObject and just have Objective-C handle the rest.
 

Attachments

  • AGStackView.zip
    3.9 KB · Views: 367
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…