我需要遍历TableView中的所有单元格,并cell.imageView
在按下按钮时设置图像.我正试着把每个细胞都拿走
[[self tableView] cellForRowAtIndexPath:[NSIndexPath indexPathForRow:i inSection:0]];
Run Code Online (Sandbox Code Playgroud)
但我需要细胞计数.
如何在TableView中查找单元格数?
我正在使用storyboard进行一个项目(第一次使用故事板).在一个viewcontroller中有一个带有mapview的视图和一个包含原型单元的tableview.我已经包含了mapkit框架,mapkit标头被导入到相应的viewcontroller中.但我得到了这个奇怪的错误.我检查了许多帖子,所有都指向不包括框架的情况.但我已经包括一切仍然得到这个问题.我清理和建立但仍然这个问题.任何建议
*** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named MKMapView'
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
@interface CategoryDetailViewController : UIViewController<UITableViewDataSource,UITableViewDelegate,MKMapViewDelegate>
@property (weak, nonatomic) IBOutlet MKMapView *mapview;
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@end
Run Code Online (Sandbox Code Playgroud) 有一个坐标对象有三个变量纬度(NSNumber),经度(NSNumber)和时间(NSDate),为了检查我的模拟器上的程序,我给了下面的代码
[coordinate setLatitude:[NSNumber numberWithDouble:23.234223]];
[coordinate setLongitude:[NSNumber numberWithDouble:73.234323]];
Run Code Online (Sandbox Code Playgroud)
但是当我NSLog coordinate.latitude和coordinate.longitude时,它会显示0.00000
NSLog(@"cordlat : %f",coordinate.latitude);
NSLog(@"cordlong : %f",coordinate.longitude);
Run Code Online (Sandbox Code Playgroud)
可能是什么问题???
是否可以在iphone中以编程方式将多个pdf文件合并为一个pdf文件.我已经从程序的不同部分创建了单独的页面,现在需要将它们合并到一个文件中
如何使用NSPredicate来满足多种条件
NSEntityDescription *entity = [NSEntityDescription entityForName:@"MessageData" inManagedObjectContext:managedObjectContext];
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
[fetchRequest setEntity:entity];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"msg_id = %@",msg_id];
[fetchRequest setPredicate:predicate];
Run Code Online (Sandbox Code Playgroud)
我需要获取其中msg_id =数组中的值的对象
如何从iphone中的corePlot(散点图)中删除负轴以及如何设置可见的图形区域?
我在我编程的uitextfield中使用
-(BOOL)textFieldShouldEndEditing:(UITextField *)textField
{
[textField resignFirstResponder];
return YES;
}
Run Code Online (Sandbox Code Playgroud)
捕获我的文本字段已完成编辑的事件.在我将焦点从一个文本字段更改为另一个文本字段或按返回的事件中,事件被触发,但如果我在文本字段中并单击另一个uicontrol,如其中的按钮,这个方法没有被解雇.这里有什么问题...我需要在用户编辑完文本字段时捕获每个事件.我也尝试textfielddidendediting
过这个事件但是错过了......如何克服这一点
我使用以下代码在fb时间轴上使用FBSDK开放图形对象和FBSDK打开图形内容共享图片和一些消息.但是下面的代码什么也没做,没有对话框,也没有发布任何内容到timeline.am我缺少此代码中的任何内容或此代码在模拟器中不起作用?
- (IBAction)shareButtonPressed:(id)sender {
NSString *contentDesc=@"abcdcccdcc";
NSString *title=[NSString stringWithFormat:@"%@ \n asd %@, asd %@",self.nameLabel.text,_fromDate.text,_toDate.text];
FBSDKSharePhoto *photo = [[FBSDKSharePhoto alloc] init];
photo.image = _profilePic.image;
photo.userGenerated = YES;
// Create an object
NSDictionary *properties = @{
@"og:type": @"memories.memory",
@"og:title":title ,
@"og:description":contentDesc
};
FBSDKShareOpenGraphObject *object = [FBSDKShareOpenGraphObject objectWithProperties:properties];
// Create an action
FBSDKShareOpenGraphAction *action = [[FBSDKShareOpenGraphAction alloc] init];
action.actionType = @"memories.view";
[action setObject:object forKey:@"memories.memory"];
// Add the photo to the action
[action setPhoto:photo forKey:@"image"];
// Create the content
FBSDKShareOpenGraphContent *content = [[FBSDKShareOpenGraphContent alloc] …
Run Code Online (Sandbox Code Playgroud) 如何在选择它并使用 UIDocumentPickerViewController 下载到设备之前在 iCloud 中找到文档的大小。我可以将文档下载到设备然后转换为 NSData,我可以确定文件大小,但是我们可以避免下载文档本身吗?在下载之前预先确定文件大小。我在 uidocumentpickerviewcontroller 中找不到任何方法或属性。
- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentAtURL:(NSURL *)url {
NSFileCoordinator *coordinator = [[NSFileCoordinator alloc] initWithFilePresenter:nil];
NSError *error = nil;
[coordinator coordinateReadingItemAtURL:url options:0 error:&error byAccessor:^(NSURL *newURL) {
//assuming the file coordinator has downloaded the file here and provided the new url here
}
}
Run Code Online (Sandbox Code Playgroud) ios ×5
iphone ×5
core-data ×1
core-plot ×1
facebook ×1
icloud ×1
mkmapview ×1
nsdate ×1
nsnumber ×1
nspredicate ×1
pdf ×1
storyboard ×1
uitableview ×1
uitextfield ×1