- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在构建一个简单的 ios 应用程序,它试图显示来自 flickr 的图像序列。问题是它有时有效,有时失败,我不确定哪里出了问题。应用程序有一个主细节 View 。当前未使用 Detailview,问题发生在 master view 本身。我正在 masterview 上设置一个刷新按钮,并在用户尝试刷新时尝试重新获取数据。
github: https://github.com/kiranjulapalli/flickrexcercise
感谢任何见解。
这里是错误:
[MasterViewController connectionDidFinishLoading:] JSON error: The operation couldn’t be completed. (Cocoa error 3840.)
代码如下:
Header MasterViewController.h:
#import <UIKit/UIKit.h>
@interface MasterViewController : UITableViewController
@property (strong, nonatomic) NSMutableData* receivedData;
@property (strong, nonatomic) NSURLConnection *connection;
@property (strong, nonatomic) NSMutableArray* items;
@end
实现:
- (void)viewDidLoad
{
[super viewDidLoad];
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(fetchFlickrData)];
self.navigationItem.rightBarButtonItem = addButton;
[self fetchFlickrData];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView
numberOfRowsInSection:(NSInteger)section
{
if ( items != nil )
{
return items.count;
}
else
{
return 0;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"previewCell";
previewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"previewCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
NSDictionary* item = [items objectAtIndex:[indexPath row]];
NSString* url = [[item objectForKey:@"media"] objectForKey:@"m"];
[cell.photo setImageWithURL:[NSURL URLWithString:url]
placeholderImage:[UIImage imageNamed:@"thumbnail.jpg"]];
return cell;
}
//获取数据
-(bool)fetchFlickrData {
// build the url for fetching json data
NSString* url = [NSString stringWithFormat:@"%@", FLICKR_PUBLIC_API_URI];
// Escape the characters in the URL
url = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
// Create the request.
NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:url]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:20.0];
connection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if (connection)
{
self.receivedData = [[NSMutableData alloc]init];
}
else
{ // Failed connection
return false;
}
return true;
}
- (void)connection:(NSURLConnection *)connection
didReceiveResponse:(NSURLResponse *)response
{
[self.receivedData setLength:0];
}
- (void)connection:(NSURLConnection *)connection
didReceiveData:(NSData *)data
{
[self.receivedData appendData:data];
}
- (void)connection:(NSURLConnection *)connection
didFailWithError:(NSError *)error
{
receivedData = nil;
NSLog(@"Connection failed! Error - %@ %@",
[error localizedDescription],
[[error userInfo] objectForKey:NSURLErrorFailingURLStringErrorKey]);
}
--
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
// do something with the data
// receivedData is declared as a method instance elsewhere
NSLog(@"Succeeded! Received %d bytes of data",[self.receivedData length]);
NSString* stringcontents = [[NSString alloc] initWithData:self.receivedData encoding:NSUTF8StringEncoding];
NSData *jsonData = [stringcontents dataUsingEncoding:NSUTF8StringEncoding];
NSError *error = nil;
NSDictionary *tempresults = jsonData ? [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:&error] : nil;
if (error) {
//*代码从上面继续://这是我看到错误的地方,它大部分时间都在发生//日志表明数据正常
NSLog(@"[%@ %@] JSON error: %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd), error.localizedDescription);
NSLog(@"%@", stringcontents);
}
if ( !error )
{
NSDictionary* tempitems = [tempresults objectForKey:@"items" ];
if ( !items )
{ // Allocate the mutable array if not already allocated
items = [[NSMutableArray alloc]init];
}
else
{
[items removeAllObjects];
}
for (NSDictionary* item in tempitems)
{
[items addObject:item];
}
[self.tableView reloadData];
}
else
{
//Alert error
}
self.connection =nil;
}
报错时的内容:
{
"title": "Uploads from everyone",
"link": "http://www.flickr.com/photos/",
"description": "",
"modified": "2013-02-24T05:49:14Z",
"generator": "http://www.flickr.com/",
"items": [
{
"title": "P1610143",
"link": "http://www.flickr.com/photos/jungandyu/8501768895/",
"media": {"m":"http://farm9.staticflickr.com/8094/8501768895_2e05d3d266_m.jpg"},
"date_taken": "2013-02-16T12:20:10-08:00",
"description": " <p><a href=\"http://www.flickr.com/people/jungandyu/\">Bighead City<\/a> posted a photo:<\/p> <p><a href=\"http://www.flickr.com/photos/jungandyu/8501768895/\" title=\"P1610143\"><img src=\"http://farm9.staticflickr.com/8094/8501768895_2e05d3d266_m.jpg\" width=\"240\" height=\"180\" alt=\"P1610143\" /><\/a><\/p> ",
"published": "2013-02-24T05:49:14Z",
"author": "nobody@flickr.com (Bighead City)",
"author_id": "19809616@N08",
"tags": ""
},
{
"title": "20121231-DSC08686.jpg",
"link": "http://www.flickr.com/photos/wasicat/8501768957/",
"media": {"m":"http://farm9.staticflickr.com/8385/8501768957_23f8a2fdcc_m.jpg"},
"date_taken": "2012-12-31T12:52:35-08:00",
"description": " <p><a href=\"http://www.flickr.com/people/wasicat/\">William0912<\/a> posted a photo:<\/p> <p><a href=\"http://www.flickr.com/photos/wasicat/8501768957/\" title=\"20121231-DSC08686.jpg\"><img src=\"http://farm9.staticflickr.com/8385/8501768957_23f8a2fdcc_m.jpg\" width=\"240\" height=\"180\" alt=\"20121231-DSC08686.jpg\" /><\/a><\/p> <p>201301015鎮西堡跨年<br /> 明新登山社<\/p>",
"published": "2013-02-24T05:49:16Z",
"author": "nobody@flickr.com (William0912)",
"author_id": "81613772@N00",
"tags": "鎮西堡 friendlyflickr 201301015鎮西堡跨年 明新登山社"
},
{
"title": "IMAG0710",
"link": "http://www.flickr.com/photos/84380329@N08/8501769085/",
"media": {"m":"http://farm9.staticflickr.com/8231/8501769085_1433e589fe_m.jpg"},
"date_taken": "2012-10-27T22:30:28-08:00",
"description": " <p><a href=\"http://www.flickr.com/people/84380329@N08/\">bmota2007<\/a> posted a photo:<\/p> <p><a href=\"http://www.flickr.com/photos/84380329@N08/8501769085/\" title=\"IMAG0710\"><img src=\"http://farm9.staticflickr.com/8231/8501769085_1433e589fe_m.jpg\" width=\"135\" height=\"240\" alt=\"IMAG0710\" /><\/a><\/p> ",
"published": "2013-02-24T05:49:20Z",
"author": "nobody@flickr.com (bmota2007)",
"author_id": "84380329@N08",
"tags": ""
},
{
"title": "IMAG0157.jpg",
"link": "http://www.flickr.com/photos/58459890@N08/8501769129/",
"media": {"m":"http://farm9.staticflickr.com/8532/8501769129_8becb3ccae_m.jpg"},
"date_taken": "2012-09-08T23:55:12-08:00",
"description": " <p><a href=\"http://www.flickr.com/people/58459890@N08/\">k7801101<\/a> posted a photo:<\/p> <p><a href=\"http://www.flickr.com/photos/58459890@N08/8501769129/\" title=\"IMAG0157.jpg\"><img src=\"http://farm9.staticflickr.com/8532/8501769129_8becb3ccae_m.jpg\" width=\"160\" height=\"240\" alt=\"IMAG0157.jpg\" /><\/a><\/p> ",
"published": "2013-02-24T05:49:22Z",
"author": "nobody@flickr.com (k7801101)",
"author_id": "58459890@N08",
"tags": ""
},
{
"title": "The Press - Work at Rockville Metro Plaza I",
"link": "http://www.flickr.com/photos/nakevanc/8501769159/",
"media": {"m":"http://farm9.staticflickr.com/8234/8501769159_c68af16b82_m.jpg"},
"date_taken": "2013-02-24T00:45:53-08:00",
"description": " <p><a href=\"http://www.flickr.com/people/nakevanc/\">Nakeva<\/a> posted a photo:<\/p> <p><a href=\"http://www.flickr.com/photos/nakevanc/8501769159/\" title=\"The Press - Work at Rockville Metro Plaza I\"><img src=\"http://farm9.staticflickr.com/8234/8501769159_c68af16b82_m.jpg\" width=\"240\" height=\"180\" alt=\"The Press - Work at Rockville Metro Plaza I\" /><\/a><\/p> ",
"published": "2013-02-24T05:49:22Z",
"author": "nobody@flickr.com (Nakeva)",
"author_id": "28116601@N02",
"tags": ""
},
{
"title": "BHS BBall Region Quarterfinals_1077.JPG",
"link": "http://www.flickr.com/photos/kbaumann/8501769163/",
"media": {"m":"http://farm9.staticflickr.com/8231/8501769163_3e54304c40_m.jpg"},
"date_taken": "2013-02-23T18:32:15-08:00",
"description": " <p><a href=\"http://www.flickr.com/people/kbaumann/\">kjbaumann<\/a> posted a photo:<\/p> <p><a href=\"http://www.flickr.com/photos/kbaumann/8501769163/\" title=\"BHS BBall Region Quarterfinals_1077.JPG\"><img src=\"http://farm9.staticflickr.com/8231/8501769163_3e54304c40_m.jpg\" width=\"159\" height=\"240\" alt=\"BHS BBall Region Quarterfinals_1077.JPG\" /><\/a><\/p> ",
"published": "2013-02-24T05:49:22Z",
"author": "nobody@flickr.com (kjbaumann)",
"author_id": "33453969@N04",
"tags": ""
},
{
"title": "DSC_1458",
"link": "http://www.flickr.com/photos/eddilui/8501769217/",
"media": {"m":"http://farm9.staticflickr.com/8099/8501769217_43f83ea28b_m.jpg"},
"date_taken": "2013-01-09T23:43:06-08:00",
"description": " <p><a href=\"http://www.flickr.com/people/eddilui/\">Eddi Lui<\/a> posted a photo:<\/p> <p><a href=\"http://www.flickr.com/photos/eddilui/8501769217/\" title=\"DSC_1458\"><img src=\"http://farm9.staticflickr.com/8099/8501769217_43f83ea28b_m.jpg\" width=\"240\" height=\"160\" alt=\"DSC_1458\" /><\/a><\/p> ",
"published": "2013-02-24T05:49:24Z",
"author": "nobody@flickr.com (Eddi Lui)",
"author_id": "68014013@N08",
"tags": ""
},
{
"title": "DSC_0112",
"link": "http://www.flickr.com/photos/pjkdmd/8501769273/",
"media": {"m":"http://farm9.staticflickr.com/8233/8501769273_63a9bb7206_m.jpg"},
"date_taken": "2013-02-23T22:00:09-08:00",
"description": " <p><a href=\"http://www.flickr.com/people/pjkdmd/\">pjkdmd<\/a> posted a photo:<\/p> <p><a href=\"http://www.flickr.com/photos/pjkdmd/8501769273/\" title=\"DSC_0112\"><img src=\"http://farm9.staticflickr.com/8233/8501769273_63a9bb7206_m.jpg\" width=\"240\" height=\"159\" alt=\"DSC_0112\" /><\/a><\/p> ",
"published": "2013-02-24T05:49:25Z",
"author": "nobody@flickr.com (pjkdmd)",
"author_id": "81759199@N08",
"tags": ""
},
{
"title": "8499469359_a854f58ba3_z",
"link": "http://www.flickr.com/photos/ury94/8501769293/",
"media": {"m":"http://farm9.staticflickr.com/8093/8501769293_f19a12de4f_m.jpg"},
"date_taken": "2013-02-24T06:49:26-08:00",
"description": " <p><a href=\"http://www.flickr.com/people/ury94/\">Hồng Anh ®<\/a> posted a photo:<\/p> <p><a href=\"http://www.flickr.com/photos/ury94/8501769293/\" title=\"8499469359_a854f58ba3_z\"><img src=\"http://farm9.staticflickr.com/8093/8501769293_f19a12de4f_m.jpg\" width=\"160\" height=\"240\" alt=\"8499469359_a854f58ba3_z\" /><\/a><\/p> ",
"published": "2013-02-24T05:49:26Z",
"author": "nobody@flickr.com (Hồng Anh ®)",
"author_id": "39951352@N03",
"tags": ""
},
{
"title": "Punggol End",
"link": "http://www.flickr.com/photos/eideticme/8502873874/",
"media": {"m":"http://farm9.staticflickr.com/8242/8502873874_790c93ed5b_m.jpg"},
"date_taken": "2012-05-26T23:29:17-08:00",
"description": " <p><a href=\"http://www.flickr.com/people/eideticme/\">eidetic.me<\/a> posted a photo:<\/p> <p><a href=\"http://www.flickr.com/photos/eideticme/8502873874/\" title=\"Punggol End\"><img src=\"http://farm9.staticflickr.com/8242/8502873874_790c93ed5b_m.jpg\" width=\"240\" height=\"160\" alt=\"Punggol End\" /><\/a><\/p> ",
"published": "2013-02-24T05:49:14Z",
"author": "nobody@flickr.com (eidetic.me)",
"author_id": "76188829@N02",
"tags": ""
},
{
"title": "IMG_0597",
"link": "http://www.flickr.com/photos/mediaocu/8502873916/",
"media": {"m":"http://farm9.staticflickr.com/8381/8502873916_a9cb6e726a_m.jpg"},
"date_taken": "2013-02-23T04:39:39-08:00",
"description": " <p><a href=\"http://www.flickr.com/people/mediaocu/\">MediaOCU<\/a> posted a photo:<\/p> <p><a href=\"http://www.flickr.com/photos/mediaocu/8502873916/\" title=\"IMG_0597\"><img src=\"http://farm9.staticflickr.com/8381/8502873916_a9cb6e726a_m.jpg\" width=\"240\" height=\"160\" alt=\"IMG_0597\" /><\/a><\/p> <p>The OCU spirit squad performed at a spirit competition in the Henry J Freede activity and wellness center on Saturday afternoon.<br /> <br /> The Campus/Michael Horn<\/p>",
"published": "2013-02-24T05:49:16Z",
"author": "nobody@flickr.com (MediaOCU)",
"author_id": "86702597@N04",
"tags": ""
},
{
"title": "Squaw Valley ski trip",
"link": "http://www.flickr.com/photos/hallucinant/8502873920/",
"media": {"m":"http://farm9.staticflickr.com/8391/8502873920_e207276293_m.jpg"},
"date_taken": "2013-02-22T10:30:59-08:00",
"description": " <p><a href=\"http://www.flickr.com/people/hallucinant/\">hallucinant<\/a> posted a photo:<\/p> <p><a href=\"http://www.flickr.com/photos/hallucinant/8502873920/\" title=\"Squaw Valley ski trip\"><img src=\"http://farm9.staticflickr.com/8391/8502873920_e207276293_m.jpg\" width=\"240\" height=\"160\" alt=\"Squaw Valley ski trip\" /><\/a><\/p> ",
"published": "2013-02-24T05:49:16Z",
"author": "nobody@flickr.com (hallucinant)",
"author_id": "62641951@N00",
"tags": ""
},
{
"title": "053/365",
"link": "http://www.flickr.com/photos/originalrocker/8502873948/",
"media": {"m":"http://farm9.staticflickr.com/8385/8502873948_06c8800be5_m.jpg"},
"date_taken": "2013-02-22T19:37:35-08:00",
"description": " <p><a href=\"http://www.flickr.com/people/originalrocker/\">originalrocker<\/a> posted a photo:<\/p> <p><a href=\"http://www.flickr.com/photos/originalrocker/8502873948/\" title=\"053/365\"><img src=\"http://farm9.staticflickr.com/8385/8502873948_06c8800be5_m.jpg\" width=\"240\" height=\"180\" alt=\"053/365\" /><\/a><\/p> <p>worst feeling ever: when your little one is feeling bad with a high fever, and you can only do so much. :(<\/p>",
"published": "2013-02-24T05:49:17Z",
"author": "nobody@flickr.com (originalrocker)",
"author_id": "49882128@N00",
"tags": "max project day ruben tracy 365 homies guzman maximiliano 2013 365dayproject uploaded:by=flickrmobile flickriosapp:filter=nofilter"
},
{
"title": "Oh qu\'il est haut, le pont du Bono...",
"link": "http://www.flickr.com/photos/dyc56/8502873962/",
"media": {"m":"http://farm9.staticflickr.com/8239/8502873962_a1851d4140_m.jpg"},
"date_taken": "2013-01-13T16:24:20-08:00",
"description": " <p><a href=\"http://www.flickr.com/people/dyc56/\">DYC56<\/a> posted a photo:<\/p> <p><a href=\"http://www.flickr.com/photos/dyc56/8502873962/\" title=\"Oh qu\'il est haut, le pont du Bono...\"><img src=\"http://farm9.staticflickr.com/8239/8502873962_a1851d4140_m.jpg\" width=\"240\" height=\"204\" alt=\"Oh qu\'il est haut, le pont du Bono...\" /><\/a><\/p> ",
"published": "2013-02-24T05:49:17Z",
"author": "nobody@flickr.com (DYC56)",
"author_id": "76919092@N08",
"tags": "bridge france art soleil eau lumière pierre bretagne breizh pont bateau morbihan soe hdr bois nikond700 ahhhlafrance nikonpassion pixeliste nikkor1424mmf28g bretagnesanspareil mordusdephotos bouboun56"
},
{
"title": "Playing a rehearsal tomorrow and the lead sheets will be only on my iPad. Lets see how this goes!",
"link": "http://www.flickr.com/photos/jasondegenhardt/8502874026/",
"media": {"m":"http://farm9.staticflickr.com/8245/8502874026_c39b545160_m.jpg"},
"date_taken": "2013-02-23T23:49:19-08:00",
"description": " <p><a href=\"http://www.flickr.com/people/jasondegenhardt/\">jasondeg<\/a> posted a photo:<\/p> <p><a href=\"http://www.flickr.com/photos/jasondegenhardt/8502874026/\" title=\"Playing a rehearsal tomorrow and the lead sheets will be only on my iPad. Lets see how this goes!\"><img src=\"http://farm9.staticflickr.com/8245/8502874026_c39b545160_m.jpg\" width=\"240\" height=\"240\" alt=\"Playing a rehearsal tomorrow and the lead sheets will be only on my iPad. Lets see how this goes!\" /><\/a><\/p> ",
"published": "2013-02-24T05:49:19Z",
"author": "nobody@flickr.com (jasondeg)",
"author_id": "40834611@N06",
"tags": "square squareformat iphoneography instagramapp uploaded:by=instagram foursquare:venue=50daa303e4b019a9f2725785"
},
{
"title": "IMG_0588",
"link": "http://www.flickr.com/photos/hmclin/8502874044/",
"media": {"m":"http://farm9.staticflickr.com/8383/8502874044_7caebe46c5_m.jpg"},
"date_taken": "2013-02-23T18:01:42-08:00",
"description": " <p><a href=\"http://www.flickr.com/people/hmclin/\">Henry McLin<\/a> posted a photo:<\/p> <p><a href=\"http://www.flickr.com/photos/hmclin/8502874044/\" title=\"IMG_0588\"><img src=\"http://farm9.staticflickr.com/8383/8502874044_7caebe46c5_m.jpg\" width=\"240\" height=\"160\" alt=\"IMG_0588\" /><\/a><\/p> ",
"published": "2013-02-24T05:49:20Z",
"author": "nobody@flickr.com (Henry McLin)",
"author_id": "95014738@N00",
"tags": ""
},
{
"title": "",
"link": "http://www.flickr.com/photos/n28307/8502874096/",
"media": {"m":"http://farm9.staticflickr.com/8228/8502874096_2494bd2d14_m.jpg"},
"date_taken": "2013-02-23T09:29:12-08:00",
"description": " <p><a href=\"http://www.flickr.com/people/n28307/\">beltz6<\/a> posted a photo:<\/p> <p><a href=\"http://www.flickr.com/photos/n28307/8502874096/\" title=\"\"><img src=\"http://farm9.staticflickr.com/8228/8502874096_2494bd2d14_m.jpg\" width=\"240\" height=\"160\" alt=\"\" /><\/a><\/p> ",
"published": "2013-02-24T05:49:21Z",
"author": "nobody@flickr.com (beltz6)",
"author_id": "23089307@N02",
"tags": "mesa ucsb universityofcalifornia afsdxvrzoomnikkor18200mmf3556gifedii"
},
{
"title": "bristow_party_124",
"link": "http://www.flickr.com/photos/amyherndonphotography/8502874102/",
"media": {"m":"http://farm9.staticflickr.com/8236/8502874102_7192f5c6f0_m.jpg"},
"date_taken": "2013-02-17T00:16:46-08:00",
"description": " <p><a href=\"http://www.flickr.com/people/amyherndonphotography/\">amy herndon<\/a> posted a photo:<\/p> <p><a href=\"http://www.flickr.com/photos/amyherndonphotography/8502874102/\" title=\"bristow_party_124\"><img src=\"http://farm9.staticflickr.com/8236/8502874102_7192f5c6f0_m.jpg\" width=\"180\" height=\"240\" alt=\"bristow_party_124\" /><\/a><\/p> ",
"published": "2013-02-24T05:49:22Z",
"author": "nobody@flickr.com (amy herndon)",
"author_id": "62464749@N08",
"tags": ""
},
{
"title": "100_1764",
"link": "http://www.flickr.com/photos/lelikadgi/8502874124/",
"media": {"m":"http://farm9.staticflickr.com/8237/8502874124_9a7a7f356e_m.jpg"},
"date_taken": "2005-08-17T12:46:26-08:00",
"description": " <p><a href=\"http://www.flickr.com/people/lelikadgi/\">lelikadgi<\/a> posted a photo:<\/p> <p><a href=\"http://www.flickr.com/photos/lelikadgi/8502874124/\" title=\"100_1764\"><img src=\"http://farm9.staticflickr.com/8237/8502874124_9a7a7f356e_m.jpg\" width=\"180\" height=\"240\" alt=\"100_1764\" /><\/a><\/p> ",
"published": "2013-02-24T05:49:22Z",
"author": "nobody@flickr.com (lelikadgi)",
"author_id": "77157992@N04",
"tags": ""
},
{
"title": "@eliseebrown",
"link": "http://www.flickr.com/photos/jj_delrosario/8502874178/",
"media": {"m":"http://farm9.staticflickr.com/8376/8502874178_5c32893a8e_m.jpg"},
"date_taken": "2013-02-24T00:49:24-08:00",
"description": " <p><a href=\"http://www.flickr.com/people/jj_delrosario/\">jj_delrosario<\/a> posted a photo:<\/p> <p><a href=\"http://www.flickr.com/photos/jj_delrosario/8502874178/\" title=\"@eliseebrown\"><img src=\"http://farm9.staticflickr.com/8376/8502874178_5c32893a8e_m.jpg\" width=\"240\" height=\"240\" alt=\"@eliseebrown\" /><\/a><\/p> ",
"published": "2013-02-24T05:49:24Z",
"author": "nobody@flickr.com (jj_delrosario)",
"author_id": "57743051@N03",
"tags": "square squareformat iphoneography instagramapp uploaded:by=instagram foursquare:venue=4b7e974ef964a5203df42fe3"
}
]
}
最佳答案
使用 NSLog(@"%@", [error debugDescription]);
进一步调试问题。
关于ios - 在 ios uitableview 中间歇性地获取 json 提要失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15048955/
IO 设备如何知道属于它的内存中的值在memory mapped IO 中发生了变化? ? 例如,假设内存地址 0 专用于保存 VGA 设备的背景颜色。当我们更改 memory[0] 中的值时,VGA
我目前正在开发一个使用Facebook sdk登录(通过FBLoginView)的iOS应用。 一切正常,除了那些拥有较旧版本的facebook的人。 当他们按下“使用Facebook登录”按钮时,他
假设我有: this - is an - example - with some - dashesNSRange将使用`rangeOfString:@“-”拾取“-”的第一个实例,但是如果我只想要最后
Card.io SDK提供以下详细信息: 卡号,有效期,月份,年份,CVV和邮政编码。 如何从此SDK获取国家名称。 - (void)userDidProvideCreditCardInfo:(Car
iOS 应用程序如何从网络服务下载图片并在安装过程中将它们安装到用户的 iOS 设备上?可能吗? 最佳答案 您无法控制应用在用户设备上的安装,因此无法在安装过程中下载其他数据。 只需在安装后首次启动应
我曾经开发过一款企业版 iOS 产品,我们公司曾将其出售给大型企业,供他们的员工使用。 该应用程序通过 AppStore 提供,企业用户获得了公司特定的配置文件(包含应用程序配置文件)以启用他们有权使
我正在尝试将 Card.io SDK 集成到我的 iOS 应用程序中。我想为 CardIO ui 做一个简单的本地化,如更改取消按钮标题或“在此保留信用卡”提示文本。 我在 github 上找到了这个
我正在使用 CardIOView 和 CardIOViewDelegate 类,没有可以设置为 YES 的 BOOL 来扫描 collectCardholderName。我可以看到它在 CardIOP
我有一个集成了通话工具包的 voip 应用程序。每次我从我的 voip 应用程序调用时,都会在 native 电话应用程序中创建一个新的最近通话记录。我在 voip 应用程序中也有自定义联系人(电话应
iOS 应用程序如何知道应用程序打开时屏幕上是否已经有键盘?应用程序运行后,它可以接收键盘显示/隐藏通知。但是,如果应用程序在分屏模式下作为辅助应用程序打开,而主应用程序已经显示键盘,则辅助应用程序不
我在模拟器中收到以下错误: ImageIO: CGImageReadSessionGetCachedImageBlockData *** CGImageReadSessionGetCachedIm
如 Apple 文档所示,可以通过 EAAccessory Framework 与经过认证的配件(由 Apple 认证)进行通信。但是我有点困惑,因为一些帖子告诉我它也可以通过 CoreBluetoo
尽管现在的调试器已经很不错了,但有时找出应用程序中正在发生的事情的最好方法仍然是古老的 NSLog。当您连接到计算机时,这样做很容易; Xcode 会帮助弹出日志查看器面板,然后就可以了。当您不在办公
在我的 iOS 应用程序中,我定义了一些兴趣点。其中一些有一个 Kontakt.io 信标的名称,它绑定(bind)到一个特定的 PoI(我的意思是通常贴在信标标签上的名称)。现在我想在附近发现信标,
我正在为警报提示创建一个 trigger.io 插件。尝试从警报提示返回数据。这是我的代码: // Prompt + (void)show_prompt:(ForgeTask*)task{
您好,我是 Apple iOS 的新手。我阅读并搜索了很多关于推送通知的文章,但我没有发现任何关于 APNS 从 io4 到 ios 6 的新更新的信息。任何人都可以向我提供 APNS 如何在 ios
UITabBar 的高度似乎在 iOS 7 和 8/9/10/11 之间发生了变化。我发布这个问题是为了让其他人轻松找到答案。 那么:在 iPhone 和 iPad 上的 iOS 8/9/10/11
我想我可以针对不同的 iOS 版本使用不同的 Storyboard。 由于 UI 的差异,我将创建下一个 Storyboard: Main_iPhone.storyboard Main_iPad.st
我正在写一些东西,我将使用设备的 iTunes 库中的一部分音轨来覆盖 2 个视频的组合,例如: AVMutableComposition* mixComposition = [[AVMutableC
我创建了一个简单的 iOS 程序,可以顺利编译并在 iPad 模拟器上运行良好。当我告诉 XCode 4 使用我连接的 iPad 设备时,无法编译相同的程序。问题似乎是当我尝试使用附加的 iPad 时
我是一名优秀的程序员,十分优秀!