我有我的應用程序非常奇怪的問題。我在我的應用程序中使用AFNetworking框架。我正在加載一些包含圖片的Feed,並通過onclick操作打開新視圖,並提供詳細描述和大圖。因此,我將IdPhoto發送到說明視圖,但是當IdPhoto超過12時,prepareForSegue會在內存中發送地址而不是IdPhoto值。的PhotoView中碼prepareForSegue不發送正確的參數
-(void)didSelectPhoto:(PhotoView*)sender {
//photo selected - show it full screen
[self performSegueWithIdentifier:@"ShowPhoto" sender:[NSNumber numberWithInt:sender.tag]];
}
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([@"ShowPhoto" compare: segue.identifier]==NSOrderedSame) {
DescrController* streamPhotoScreen = segue.destinationViewController;
streamPhotoScreen.IdPhoto = sender;
}
}
部分
-(id)initWithIndex:(int)i andData:(NSDictionary*)data {
self = [super init];
if (self !=nil) {
//initialize
self.tag = [[data objectForKey:@"IdPhoto"] intValue];
,所以我不明白爲什麼它不發送IdPhoto另一種觀點認爲當值多於12
你如何申報'IdPhoto'在'DescrController'? –