小编iDe*_*Dev的帖子

"找不到NSObject的接口声明"?

所以我对这个问题进行了一些研究,但我还没有找到类似的东西......

所以我使用Xcode和Sparrow Framework在Obj-C中编写游戏.到目前为止,我一直在模拟器上工作,而且一切都很顺利.但是当我切换到在我的设备上运行它时,我会得到各种错误,应该是标准的,例如"无法找到NSObject的接口声明","未知的类型名称'NSMutableArray'"等我已经有了#在每个班级导入,所以你会认为它不应该发生,对吧?我觉得这只是一两行需要改变的地方 - 但我不知道在哪里或哪里.

如果有人有任何建议,将非常感谢.:)

编辑:这是一个给出错误的.h文件的屏幕截图 - 它似乎只出现在我创建的一些.h文件中.http://i.imgur.com/EuQh4.png

xcode objective-c ios sparrow-framework

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

如何以编程方式设置UIButton的Highlight Tint颜色?

Highlight TintInterface Builder中有一个选项UIButton.是否有可能UIButton在iOS 5中以编程方式更改它....使用某种外观协议或其他一些解决方法?

objective-c ios ios5

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

如何在iPad中的故事书应用程序中进行页面卷曲

我正在制作一个故事书应用程序,我想像下面的视频一样进行页面卷曲.

演示视频

任何人都可以告诉我如何做到这一点.

更新:

我希望这个页面卷曲以支持iOS 4.3+.UIPageViewController仅适用于iOS 6.

objective-c page-curl ipad ios

11
推荐指数
1
解决办法
3138
查看次数

在iPad中,UIImagePickerController必须通过UIPopoverController呈现

我已经从相机创建了一个捕获图像的应用程序.这是我的代码

 -(IBAction) showCameraUI {
    BOOL hasCamera = [UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera];
    UIImagePickerController* picker = [[UIImagePickerController alloc] init];
    picker.delegate = self;
    picker.sourceType = hasCamera ? UIImagePickerControllerSourceTypeCamera :    UIImagePickerControllerSourceTypePhotoLibrary;
    [self presentModalViewController:picker animated:YES];
}
Run Code Online (Sandbox Code Playgroud)

并实现了这种委托方法来获取捕获的图像

- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info
{
    [picker dismissModalViewControllerAnimated:YES];
    UIImage* image = [info objectForKey:UIImagePickerControllerOriginalImage];
    UIImage *yourImageView = image;
}
Run Code Online (Sandbox Code Playgroud)

如果用户取消控制器,则实现此方法

- (void)imagePickerControllerDidCancel:(UIImagePickerController*)picker
{
    [picker dismissModalViewControllerAnimated:YES];
}
Run Code Online (Sandbox Code Playgroud)

但它显示了这个例外.有没有人知道为什么它在执行函数showCameraUI的最后一行后显示这样的异常.

UIStatusBarStyleBlackTranslucent is not available on this device. 2013-02-07 
10:06:06.976 CaptureImage[460:c07] *** Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: 'On iPad, UIImagePickerController must be …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c ipad ios ios6

11
推荐指数
2
解决办法
9443
查看次数

UIPopoverController在没有委托调用的情况下解散

我有一个地图视图,我annotations根据一个开关添加和删​​除popovercontroller.当我在外面触摸时popover,它正确地解散并调用delegate方法popoverControllerDidDismissPopover: 我遇到的问题是当我切换popover(在弹出视图中触摸)中的开关时,如果我annotations从地图中移除它的行为正确并且弹出保持可见但如果我将其添加annotations到地图视图,则popover消失并且delegate不调用该方法.有没有人遇到过这种行为?

交换机的on和off代码之间的唯一区别是,一个annotations从数组中删除,而另一个添加annotations.添加annotations到地图视图时,这只是一个问题.任何帮助或建议将不胜感激.

popover是显示的方式:

-(IBAction)toggleMapFiltersView:(id)sender
 {
    LayerPopoverViewController *popOverViewController = [[LayerPopoverViewController alloc] init];
    [popOverViewController setDelegate:self];
    [popOverViewController setBranchesShowing:branchesShowing];
    [popOverViewController setSchoolsShowing:schoolsShowing];

    [layersButton setSelected:YES];

    popoverController = [[UIPopoverController alloc]   initWithContentViewController:popOverViewController];


    [popoverController setDelegate:self];
    [popOverViewController release];
    [popoverController presentPopoverFromRect:layersButton.frame
                                       inView:[self view] 
                     permittedArrowDirections:UIPopoverArrowDirectionAny 
                                     animated:YES];
}
Run Code Online (Sandbox Code Playgroud)

这是从popover视图调用的方法:

-(IBAction)toggleSchools:(id)sender
{
    if ([self.delegate respondsToSelector:@selector(didChangeSchoolsDisplaySettingWithVisible:)])
    {
        if ([schoolsSwitch isOn])
        {
        [self.delegate didChangeSchoolsDisplaySettingWithVisible:YES];
             self.schoolsShowing = YES;
        } …
Run Code Online (Sandbox Code Playgroud)

iphone mkmapview uipopovercontroller ios

10
推荐指数
1
解决办法
1125
查看次数

如何将UIImage和UILabel组合成一个图像并保存

我有2个UILabel和2个图像,我需要合并到一个UIImage中进行保存.

我知道我可以用屏幕截图来做,但是我的主要图像是圆形的,所以如果我将其缩小,它仍然会显示出锐利的边缘.

我可以这样做来组合图像:

//CGSize newImageSize = CGSizeMake(cropImage.frame.size.width, cropImage.frame.size.height);
CGSize newImageSize = CGSizeMake(480, 320);
NSLog(@"CGSize %@",NSStringFromCGSize(newImageSize));

UIGraphicsBeginImageContextWithOptions(newImageSize, NO, 0.0); //retina res
[self.viewForImg.layer renderInContext:UIGraphicsGetCurrentContext()];

UIImage *image = UIGraphicsGetImageFromCurrentImageContext();

NSData *imgData =  UIImageJPEGRepresentation(image, 0.9); //UIImagePNGRepresentation ( image ); // get JPEG representation
UIImage * imagePNG = [UIImage imageWithData:imgData]; // wrap UIImage around PNG representation

UIGraphicsEndImageContext();
return imagePNG;
Run Code Online (Sandbox Code Playgroud)

但不知道如何添加UILabel.

任何回复都非常感谢.

iphone xcode uiimageview uiimage ios

10
推荐指数
1
解决办法
8280
查看次数

iOS - 使用闭包的AVPlayer

我正在使用iOS上的AVPlayer使用"closedCaptionDisplayEnabled属性"来显示电影上的字幕或副标题(hls或mp4),但标题没有显示任何内容.我不知道为什么?

你有解决方案在电影(hls,mp4)上显示字幕(副标题)吗?

我看到一些关于app,youtube,netflix,tvguide以及用于隐藏字幕的内容的示例.

也许所有iPhone上的应用程序,ifl来自netflix,youtube使用一个文件并在视频中插入字幕,我想

但是,我想使用两个文件(一个文件hls或mp4,一个文件srt或WebVTT)

image1,image2

感谢您阅读本文!!!!

captions ios

10
推荐指数
2
解决办法
6681
查看次数

更改UIBarbuttonItems颜色

如何将UIBarButtonItem's颜色设置为绿色?我使用的是iOS 4,没有色彩属性.请帮我.

uinavigationbar uibarbuttonitem ios

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

如何通过代码判断iPad是黑色还是白色?

我想知道是否有办法通过代码判断iPad是黑色还是白色?一个简单的谷歌搜索没有发现任何东西.

cocoa-touch ipad ios ios5

9
推荐指数
1
解决办法
4664
查看次数