objective c - get result from connectionDidFinishLoading -
i don't know how result connectiondidfinishloading. have these codes:
connect.m:
- (void)connectiondidfinishloading:(nsurlconnection *)connection { [[uiapplication sharedapplication] setnetworkactivityindicatorvisible:no]; nsstring *result = [[nsstring alloc] initwithbytes:[self.dataresponse bytes] length:[self.dataresponse length] encoding:nsutf8stringencoding]; } videos.m:
@property (nonatomic, retain) connect *connect; - (void)viewdidload { self.connect = [[connect alloc] initwithdelegate:self onsuccess:@selector(responsesuccess:) onerror:@selector(responseerror:)]; } i want know how get, in videos.m result connect.m
connectiondidfinishloading tells your done. you'll want implement protocol nsurlconnectiondatadelegate , use connection:didreceivedata: gather data.
be aware data comes in in multiple chunks, connection:didreceivedata: called multiple times , you'll have keep appending new chunk of data end until connectiondidfinishloading gets called.
Comments
Post a Comment