我需要開發一個應用程序,需要調用另一個應用程序,它位於本地主機中。我已經在stackoverflow中發佈了相同的問題,它根據它。但我沒有得到在iPhone simulator.Guide的輸出中我的編碼是什麼錯誤,使得看上去在調試時從調試Objective-C編程從另一個應用程序調用應用程序
塊引用
錯誤:無法勞克模擬應用:iPhone Simulator未能安裝該應用程序。
#import "ModuleManagerAppDelegate.h"
@implementation ModuleManagerAppDelegate
@synthesize window;
- (void)applicationDidFinishLaunching:(UIApplication *)application {
NSURL *myURL = [NSURL URLWithString:@"backgroundcolor:backgroundcolor"];
[[UIApplication sharedApplication] openURL:myURL];
[window makeKeyAndVisible];
[myURL release];
}
- (void)dealloc
{
[window release];
[super dealloc];
}
@end
這是調用應用程序和我打電話的BACKGROUNDCOLOR作爲被叫application.I也於info.plist.This註冊BACKGROUNDCOLOR是我的info.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSMainNibFile</key>
<string>MainWindow</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>com.xxx.backgroundcolor.xcodeproj</string>
<key>CFBundleURLSchemes</key>
<array>
<string>backgroundcolor.xcodeproj</string>
</array>
</dict>
</array>
</dict>
</plist>
這是我的稱爲應用(BackgroundColor.m)
#import "BackgroundColorAppDelegate.h"
@implementation BackgroundColorAppDelegate
@synthesize window;
@synthesize Orange,Green,Yellow,Blue,Red;
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// Override point for customization after application launch
[window makeKeyAndVisible];
}
-(BOOL)application:(UIApplication *) application handleOpenURL:(NSURL *)url
{
if([[url scheme] isEqualToString:@"backgroundcolor"])
{
-(IBAction)doOrange
{
window.backgroundColor=[UIColor orangeColor];
}
-(IBAction)doBlue
{
window.backgroundColor=[UIColor blueColor];
}
-(IBAction)doGreen
{
window.backgroundColor=[UIColor greenColor];
}
-(IBAction)doRed
{
window.backgroundColor=[UIColor redColor];
}
-(IBAction)doYellow
{
window.backgroundColor=[UIColor yellowColor];
}
}
- (void)dealloc {
[window release];
[super dealloc];
}
@end
感謝您的回覆。請也回答我的問題..請幫助我...... – suse 2009-11-17 08:35:02