iphone - ios method param assign global variable -
Why is the class NSMutableArray arl count still 0?
Is there any way around this?
Class B
BH # import & lt; Foundation / Foundation. H & gt; # Imports "AH" @Interface B: NSOBEIS - (zero) DOSMANG; ", @" 3 ", @" 4 ", zero]; A * A = [[A allot] init]; [one getValue: array];}
class A
ah
#import & lt; UKit / UKit.h & gt; @ class B; @ Intifes A: UIViewController; @ property (strong, Nonatomic) Ansamayutiablare * Arl; - array (zero) GetValue: (NSMutableArray *); - (IBAction) button: (id) this; @end
Am
@implementation A @ synthesis Arley; - (void) Drishydidlod {[super Wudidlod ]; B * B = [[B Elok] Init] [B Dotsing];} - (void) getValue: (NSMutableArray *) array {arl = array; // arl = [[NSMutableArray alloc] initWithArray: Array]; // [arl addObjectFromArray: Array]; Anselog (@ "Arlk count:% d", [Arl count]); // is connected here 4 - (IBAction) button: (id) sender {Anselog (@ "Arl count:% d", [Arl count]); // log on here 0}
"post-text" itemprop = "text">You do
A
indoSomething
. This example is not the same as the example associated with yourbutton:
method, witharl
is not even started and therefore there are no items in it, so counting zero when thebutton is called
Comments
Post a Comment