0

我想导航到另一个视图。我喜欢现在播放我的广播应用程序的按钮。我希望视图能够改变它的状态......我想要浏览的视图有一个用于放射线的url的文本字段和一个用于收音机名称的标签。所以我该如何考虑这种观点的状态,因为现在,当我尝试导航时,它可以很好地导航,但文本字段发生变化..所以我可以做些什么来不改变文本? 这里是一些代码抱歉奇怪的名字导航到另一个视图iPhone SDK?

if (self.bookDetailViewController_1 == nil) 
{ 
    iPhoneStreamingPlayerViewController *aBookDetail = [[iPhoneStreamingPlayerViewController alloc] initWithNibName:@"iPhoneStreamingPlayerView" bundle:nil]; 
    self.bookDetailViewController_1= aBookDetail; 
    [aBookDetail release]; 
} 

Music_appAppDelegate *delegate = [[UIApplication sharedApplication]delegate]; 
[delegate.booksNavController pushViewController:bookDetailViewController_1 animated:YES]; 
+0

你好,请你可以把你在正确的格式代码,所以我可以帮你。 – 2011-05-01 12:39:14

+0

是的,当然很抱歉 – 2011-05-03 00:49:05

+0

请看看代码格式化的问题 – 2011-05-03 00:51:29

回答

0

辛格尔顿实施

//.h 

+ (className *)sharedInstance; 


//.m 

static className* sharedInstance = nil; 

@implementation className 

+ (className*)sharedInstance { 
    if (!sharedInstance) { 
     sharedInstance = [[super allocWithZone:NULL] init]; 
    } 

    return sharedInstance; 
} 

+ (id)allocWithZone:(NSZone *)zone { 
    return [[self sharedInstance] retain]; 
} 

- (id)copyWithZone:(NSZone *)zone { 
    return self; 
} 

- (id)retain { 
    return self; 
} 

- (NSUInteger)retainCount { 
    return NSUIntegerMax; 
} 

- (void)release { } 

- (id)autorelease { 
    return self; 
} 


@end 
相关问题