我试图在我的UIScrollView中滚动"循环",但不成功.
我想做什么:如果uiscrollview到达结束,如果uiscrollview在开始并向后移动它应该移动到开始,它应该移动到结束
在我的情况下附加scrollview不是好方法(其他方法应该得到"页面ID")
你有什么想法吗?
我想在其他应用程序中从Web打开文件.
我的代码:
NSURLRequest *req = [[NSURLRequest alloc] initWithURL:url];
[NSURLConnection sendAsynchronousRequest:req queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *resp, NSData *respData, NSError *error){
NSLog(@"resp data length: %i", respData.length);
NSArray *names = [objDict[@"name"] componentsSeparatedByString:@"."];
NSString *fileName = [@"downloaded." stringByAppendingString:names[names.count-1]];
NSString * path = [NSTemporaryDirectory() stringByAppendingPathComponent:fileName];
NSError *errorC = nil;
BOOL success = [respData writeToFile:path
options:NSDataWritingFileProtectionComplete
error:&errorC];
if (success) {
UIDocumentInteractionController *documentController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:path]];
documentController.delegate = self;
[documentController presentOptionsMenuFromRect:CGRectZero inView:self.view animated:YES];
} else {
NSLog(@"fail: %@", errorC.description);
}
}];
Run Code Online (Sandbox Code Playgroud)
它显示面板,但在点击任何按钮时崩溃(不仅仅是"取消").
我启用了僵尸对象,它写道:
-[UIDocumentInteractionController URL]: message sent …Run Code Online (Sandbox Code Playgroud) 伙计们,这是我的代码:
- (void) renderPageAtIndex:(NSUInteger)index inContext:(CGContextRef)ctx {
//background
CGContextSetFillColorWithColor(ctx, [[UIColor colorWithRed:((float)238 / 255.0f) green:((float)233 / 255.0f) blue:((float)215 / 255.0f) alpha:1] CGColor]);
CGContextFillRect(ctx, CGRectInset(leavesView.bounds, 0, 0));
//text
CGContextSetTextDrawingMode(ctx, kCGTextFill);
CGContextSetTextMatrix(ctx, CGAffineTransformMake(1.0, 0.0, 0.0, 1.0, 0.0, 0.0));
CGContextSetFillColorWithColor(ctx, [[UIColor blackColor] CGColor]);
UIGraphicsPushContext(ctx);
CGContextSaveGState(ctx);
CGContextTranslateCTM(ctx, 0.1f, leavesView.bounds.size.height);
CGContextScaleCTM(ctx, 1.0f, -1.0f);
CGRect textRect = CGRectMake(5, 5, leavesView.bounds.size.width-10, leavesView.bounds.size.height-10);
if (pages.count > 0 && pages.count-1 >= index) {
[[pages objectAtIndex:index] drawInRect:textRect withFont:font lineBreakMode:UILineBreakModeWordWrap alignment:UITextAlignmentLeft];
}
CGContextRestoreGState(ctx);
UIGraphicsPopContext();
}
Run Code Online (Sandbox Code Playgroud)
它在iPhone 2G,3G,3GS上运行完美,但在新机型上我遇到了问题.
在视网膜上,文字不会像标准中那样使分辨率加倍.
你有什么想法吗?
我想在我的RSS阅读器中制作一个"收藏夹".我的RSS解析器正在解析NSMutableArray的RSS提要,然后从我的部分rss(选定的帖子)创建对象"item".我的代码:
//Creating mutable array and adding items:
- (void)viewDidLoad {
if (favoritedAlready == nil) {
favoritedAlready = [[NSMutableArray alloc] init];
[[NSUserDefaults standardUserDefaults] setObject:favoritedAlready forKey:@"favorites"];
[[NSUserDefaults standardUserDefaults] synchronize];
NSLog(@"????????? ? ????");
}
}
- (void) addToFavorites {
NSMutableArray* favoritedAlready = [[NSUserDefaults standardUserDefaults] objectForKey:@"favorites"];
[favoritedAlready addObject: item];
[[NSUserDefaults standardUserDefaults] setObject:favoritedAlready forKey:@"favorites"];
[[NSUserDefaults standardUserDefaults] synchronize];
NSLog(@"????????? ? ?????????. ? ????????? %i ??????", [favoritedAlready count]);
}
//Removing items (another View)
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
rssItems = [[NSUserDefaults standardUserDefaults] objectForKey:@"favorites"];
[self.tableView reloadData];
NSLog(@"??????????? ?????????, …Run Code Online (Sandbox Code Playgroud) 我有0.99美元的iOS应用程序,我担心有人想破解它.如何保护我的应用免受破解者的侵害?
我是box2d的新手.你能帮助我吗?我想制造枪(触摸,移动,停止,飞行).我做了枪的检测和旋转,但是我不能让球突然出现.我如何计算速度,我需要将其设置为球?非常感谢你
属性标识符ACAccount是否对所有设备都是唯一的?
文档无法说明任何内容,只是"唯一标识符".在一台设备上还是在所有设备上?
我试图用自动文本换行创建UITextField,但我不能这样做.
ios ×7
iphone ×4
cocoa-touch ×3
objective-c ×2
xcode ×2
acaccount ×1
box2d ×1
box2d-iphone ×1
cracking ×1
cydia ×1
jailbreak ×1
uikit ×1
uiscrollview ×1
uitextfield ×1
xcode4 ×1