我的代码中有这个switch语句:
switch(buttonIndex){
case 0:
[actionSheet dismissWithClickedButtonIndex:buttonIndex animated:YES];
break;
case 1:
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:[imagePicker autorelease] animated:YES];
break;
default:
[self openEmailViewInViewController:self];
}
Run Code Online (Sandbox Code Playgroud)
在案例1中的UIImagePickerController实例化中,我收到一个错误:
error:expected expression before 'UIImagePickerController'
Run Code Online (Sandbox Code Playgroud)
我不知道我做错了什么.思考?
哦,buttonIndex是一个NSInteger
我想把一组矩形与相应的动作联系起来,所以我试着这样做
struct menuActions {
CGRect rect;
SEL action;
};
struct menuActions someMenuRects[] = {
{ { { 0, 0 }, {320, 60 } }, @selector(doSomething) },
{ { { 0, 60}, {320, 50 } }, @selector(doSomethingElse) },
};
Run Code Online (Sandbox Code Playgroud)
但我得到错误"初始化元素不是常数".是否有某些原因使我想要做的事情一般不被允许,或者在全球范围内不被允许,或者我是否有某种轻微的标点错误?
我有一个项目,包含一堆.png文件,我想将其转换为PVRTC压缩纹理.现在,我正在使用一个自定义的XCode运行脚本阶段,如下所示:
TEXTURE_TOOL=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/texturetool
$TEXTURE_TOOL -e PVRTC --bits-per-pixel-2 -o "$SRCROOT/images/select_menu_bgs1.pvr" -f PVR "$SRCROOT/images/select_menu_bgs1.png"
$TEXTURE_TOOL -e PVRTC --bits-per-pixel-2 -o "$SRCROOT/images/select_menu_bgs2.pvr" -f PVR "$SRCROOT/images/select_menu_bgs2.png"
Run Code Online (Sandbox Code Playgroud)
但是必须让它明确包含我需要转换的文件的确切列表是令人讨厌的.(它们还需要添加到构建步骤的输入和输出属性中,这是更烦人的部分.)
我想做的是使用"make"轻松实现:有一条规则说"如果项目中有.pvr,它是使用此命令行从相应的.png构建的".
在XCode中有可能是这样的吗?
是否可以在通过iPhone OS 3.0上的MFMailComposeViewController发送的HTML电子邮件中嵌入对图像的引用?
(void)addAttachmentData:(NSData*)attachment mimeType:(NSString*)mimeType fileName:(NSString*)filename
Run Code Online (Sandbox Code Playgroud)
似乎没有提供任何设置或读取附件的Content-ID标头的方法,但有没有办法使这项工作?
我见过这样做的应用程序,但他们可能正在使用SKPSMTPMessage ......
我显然在iPhone Xcode项目中改变了一些东西,现在当它预编译我正在获得的标题时
In file included from [...] /Foundation.framework/Headers/Foundation.h:8,
from [...] /UIKit.framework/Headers/UIAccelerometer.h:8,
from [...] /UIKit.framework/Headers/UIKit.h:9:
/Developer/Platforms/[...]/NSObjCRuntime.h:146: error: stray '@' in program
/Developer/Platforms/[...]/NSObjCRuntime.h:146: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'NSString'
Run Code Online (Sandbox Code Playgroud)
再多5800个错误......
我希望其他人最近这样做,并指出我正确的方向!