0
シンプルなコードはこちらです。NSURLConnectionオブジェクトは解放できません。
.h
@interface testXML : UIViewController {
NSURLConnection *connect;
}
@property (nonatomic, retain) NSURLConnection *connect;
.m
@synthesize connect;
- (void)viewDidLoad {
connect = [[NSURLConnection alloc] init];
self.connect = [[NSURLConnection alloc] init];
[super viewDidLoad];
}
viewDidLoadが呼び出されると、EXC_BAD_ACCESS信号を受信します。
問題が何ですか?
ありがとうございます!
再生いただきありがとうございます。しかし問題は、オブジェクトを解放して新しいオブジェクトを指す必要があるときです。それはダウンするだろう。 – Jerry
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {connection = nil; } - (void)connectionDidFinishLoading:(NSURLConnection *)接続{ 接続= nil; } – Shreesh