English 中文(简体)
i 电话,通过各班之间的阵列? [闭门]
原标题:iphone, pass an array between classes? [closed]
  • 时间:2011-03-10 11:15:58
  •  标签:
  • iphone
最佳回答

What you want are simple object members to set. The best way to achive this is to use properties: http://developer.apple.com/library/ios/#referencelibrary/GettingStarted/Learning_Objective-C_A_Primer/_index.html#//apple_ref/doc/uid/TP40007594

页: 1 B.h:

@property(nonatomic,retain) NSArray * theArray_B;

页: 1

@synthesize theArray_B;

页: 1

myB_Instance.theArray_B = theArrayToPass;

在这种例子中,A和B与同一记忆中的阿雷-奥目标有着共同点。 此外,B拥有这个Array(A也是这样),因为它有保留。

问题回答

与此类似:

A类:

- (void)someMethodInClassA {
    NSArray *arrayData = // ... stuff

    ClassB *classB = // ... stuff

    [classB aMethod:arrayData];

}

B类:

- (void)aMethod:(NSArray *)array {
    // do something with the array
}

页: 1 http://howtomakeiphoneapps.com/objective-c-tutorial/"rel=“nofollow”http://howtomakeiphoneapps.com/objective-c-tutorial/。

使用。

a. 编组,使其财产归为一体。 然后推向下观点,然后将从航站的 pick子用于排入阵列。 参看这一点。

 FirstView *obj=(FirstView *)[self.navigationController.viewControllers objectAtIndex: [self.navigationController.viewControllers count]-2];

 //obj.array is the array which you want to use.




相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签