小编suj*_*406的帖子

如何在UITableView中找到Cell的数量

我需要遍历TableView中的所有单元格,并cell.imageView在按下按钮时设置图像.我正试着把每个细胞都拿走

[[self tableView] cellForRowAtIndexPath:[NSIndexPath indexPathForRow:i inSection:0]];
Run Code Online (Sandbox Code Playgroud)

但我需要细胞计数.

如何在TableView中查找单元格数?

uitableview

20
推荐指数
3
解决办法
4万
查看次数

如何获得具有毫秒精度的nsdate?

我需要以毫秒精度获得时间.我怎么能得到它NSDate.目前,当我的NSLog时间,它只显示秒.

nsdate ios

20
推荐指数
3
解决办法
3万
查看次数

'NSInvalidUnarchiveOperationException',原因:'无法实例化名为MKMapView的类'

我正在使用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)

storyboard mkmapview ios

17
推荐指数
3
解决办法
1万
查看次数

使用[NSNumber numberWithDouble:]将double转换为NSNumber

有一个坐标对象有三个变量纬度(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 nsnumber

16
推荐指数
1
解决办法
2万
查看次数

是否可以在iphone中以编程方式将多个pdf文件合并为一个pdf文件?

是否可以在iphone中以编程方式将多个pdf文件合并为一个pdf文件.我已经从程序的不同部分创建了单独的页面,现在需要将它们合并到一个文件中

pdf iphone ios

8
推荐指数
2
解决办法
4604
查看次数

nspredicate数组中的多个项目

如何使用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 core-data nspredicate

5
推荐指数
1
解决办法
2202
查看次数

从iphone中的coreplot(散点图)中删除负轴

如何从iphone中的corePlot(散点图)中删除负轴以及如何设置可见的图形区域?

iphone core-plot

5
推荐指数
1
解决办法
2369
查看次数

当我结束编辑时,不会触发textfieldDidEndEditing方法,并选择另一个uicontrol而不是textfield

我在我编程的uitextfield中使用

-(BOOL)textFieldShouldEndEditing:(UITextField *)textField
{
[textField resignFirstResponder];
return YES;
}
Run Code Online (Sandbox Code Playgroud)

捕获我的文本字段已完成编辑的事件.在我将焦点从一个文本字段更改为另一个文本字段或按返回的事件中,事件被触发,但如果我在文本字段中并单击另一个uicontrol,如其中的按钮,这个方法没有被解雇.这里有什么问题...我需要在用户编辑完文本字段时捕获每个事件.我也尝试textfielddidendediting过这个事件但是错过了......如何克服这一点

iphone uitextfield

5
推荐指数
1
解决办法
6820
查看次数

在应用程序内共享fb图像和消息内容无法使用FBSDKShareDialog

我使用以下代码在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)

facebook facebook-graph-api ios facebook-ios-sdk

5
推荐指数
1
解决办法
5416
查看次数

如何在使用 UIDocumentPickerViewController 选择并下载到设备之前在 iCloud 中找到文档的大小

如何在选择它并使用 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 icloud uidocumentpickervc

5
推荐指数
1
解决办法
1148
查看次数