phlippi
17.09.2009, 16:28
Hallo auch. Ich hoffe jetzt einfach mal, dass ich damit in der richtigen Kategorie bin, ansonsten sorry ;)
Hoffe auch, dass sich damit überhaupt jemand auskennt.
Also nun mein Problem:
Habe mir vor kurzem mal winchain runtergeladen um mit cygwin auf Windows iPhone cydia/homebrews apps zu machen ;)
Wollte natürlich erstmal ausprobieren, also hab ich erstmal ein UIKit Fenster Objekt erstellt um zu sehen, ob das ganze überhaupt funktioniert.
Theoretisch dürfte ich nun auf den iPod ein total leeres Fenster haben. Aber aus irgendeinem Grund, schließt sich das app einen bruchteil einer Sekunde nach dem starten. Mein Code sieht folgendermaßen aus:
makefile:
INFOPLIST_FILE=Info.plist
SOURCES=\
main.m \
MyExample.m
CC=/usr/local/bin/arm-apple-darwin-gcc
CFLAGS=-g -O2 -Wall
LD=$(CC)
LDFLAGS=-lobjc -framework CoreFoundation -framework Foundation -framework UIKit
PRODUCT_NAME=MyExample
SRCROOT=/iphone-apps/MyExample
WRAPPER_NAME=$(PRODUCT_NAME).app
EXECUTABLE_NAME=$(PRODUCT_NAME)
SOURCES_ABS=$(addprefix $(SRCROOT)/,$(SOURCES))
INFOPLIST_ABS=$(addprefix $(SRCROOT)/,$(INFOPLIST_FILE))
OBJECTS=\
$(patsubst %.c,%.o,$(filter %.c,$(SOURCES))) \
$(patsubst %.cc,%.o,$(filter %.cc,$(SOURCES))) \
$(patsubst %.cpp,%.o,$(filter %.cpp,$(SOURCES))) \
$(patsubst %.m,%.o,$(filter %.m,$(SOURCES))) \
$(patsubst %.mm,%.o,$(filter %.mm,$(SOURCES)))
OBJECTS_ABS=$(addprefix $(CONFIGURATION_TEMP_DIR)/,$(OBJECTS))
APP_ABS=$(BUILT_PRODUCTS_DIR)/$(WRAPPER_NAME)
PRODUCT_ABS=$(APP_ABS)/$(EXECUTABLE_NAME)
all: $(PRODUCT_ABS)
$(PRODUCT_ABS): $(APP_ABS) $(OBJECTS_ABS)
$(LD) $(LDFLAGS) -o $(PRODUCT_ABS) $(OBJECTS_ABS)
$(APP_ABS): $(INFOPLIST_ABS)
mkdir -p $(APP_ABS)
cp $(INFOPLIST_ABS) $(APP_ABS)/
$(CONFIGURATION_TEMP_DIR)/%.o: $(SRCROOT)/%.m
mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
clean:
echo rm -f $(OBJECTS_ABS)
echo rm -rf $(APP_ABS)
main.m:
#import "MyExample.h"
int main(int argc, char **argv)
{
NSAutoreleasePool *autoreleasePool = [
[ NSAutoreleasePool alloc ] init
];
int returnCode = UIApplicationMain(argc, argv, [ MyApp class ]);
[ autoreleasePool release ];
return returnCode;
}
@implementation MyApp
- (void)applicationDidFinishLaunching:(NSNotificatio n *)aNotification {
window = [ [ UIWindow alloc ] initWithContentRect:
[ UIHardware fullScreenApplicationContentRect ]
];
CGRect windowRect =
[ UIHardware fullScreenApplicationContentRect ];
windowRect.origin.x = windowRect.origin.y = 0.0f;
mainView = [ [ UIView alloc ] initWithFrame: windowRect ];
[ window setContentView: mainView ];
[ window orderFront: self ];
[ window makeKey: self ];
[ window _setHidden: NO ];
}
@end
myExample.h
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface MyApp : UIApplication {
UIWindow *window;
UIView *mainView;
}
@end
myExample.m:
#import "MyExample.h"
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <CoreFoundation/CoreFoundation.h>
MyExample_Prefix:
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#endif
Denke nicht, dass das wichtig ist, aber hier die info.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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>CFBundleExecutable</key>
<string>MyExample</string>
<key>CFBundleIdentifier</key>
<string>com.Phil.MyExample</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
</dict>
</plist>
In der cygwin konsole mache ich den build folgendermaßen:
cd C:/cygwin/iphone-apps/MyExample
make
Hoffe auch, dass sich damit überhaupt jemand auskennt.
Also nun mein Problem:
Habe mir vor kurzem mal winchain runtergeladen um mit cygwin auf Windows iPhone cydia/homebrews apps zu machen ;)
Wollte natürlich erstmal ausprobieren, also hab ich erstmal ein UIKit Fenster Objekt erstellt um zu sehen, ob das ganze überhaupt funktioniert.
Theoretisch dürfte ich nun auf den iPod ein total leeres Fenster haben. Aber aus irgendeinem Grund, schließt sich das app einen bruchteil einer Sekunde nach dem starten. Mein Code sieht folgendermaßen aus:
makefile:
INFOPLIST_FILE=Info.plist
SOURCES=\
main.m \
MyExample.m
CC=/usr/local/bin/arm-apple-darwin-gcc
CFLAGS=-g -O2 -Wall
LD=$(CC)
LDFLAGS=-lobjc -framework CoreFoundation -framework Foundation -framework UIKit
PRODUCT_NAME=MyExample
SRCROOT=/iphone-apps/MyExample
WRAPPER_NAME=$(PRODUCT_NAME).app
EXECUTABLE_NAME=$(PRODUCT_NAME)
SOURCES_ABS=$(addprefix $(SRCROOT)/,$(SOURCES))
INFOPLIST_ABS=$(addprefix $(SRCROOT)/,$(INFOPLIST_FILE))
OBJECTS=\
$(patsubst %.c,%.o,$(filter %.c,$(SOURCES))) \
$(patsubst %.cc,%.o,$(filter %.cc,$(SOURCES))) \
$(patsubst %.cpp,%.o,$(filter %.cpp,$(SOURCES))) \
$(patsubst %.m,%.o,$(filter %.m,$(SOURCES))) \
$(patsubst %.mm,%.o,$(filter %.mm,$(SOURCES)))
OBJECTS_ABS=$(addprefix $(CONFIGURATION_TEMP_DIR)/,$(OBJECTS))
APP_ABS=$(BUILT_PRODUCTS_DIR)/$(WRAPPER_NAME)
PRODUCT_ABS=$(APP_ABS)/$(EXECUTABLE_NAME)
all: $(PRODUCT_ABS)
$(PRODUCT_ABS): $(APP_ABS) $(OBJECTS_ABS)
$(LD) $(LDFLAGS) -o $(PRODUCT_ABS) $(OBJECTS_ABS)
$(APP_ABS): $(INFOPLIST_ABS)
mkdir -p $(APP_ABS)
cp $(INFOPLIST_ABS) $(APP_ABS)/
$(CONFIGURATION_TEMP_DIR)/%.o: $(SRCROOT)/%.m
mkdir -p $(dir $@)
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
clean:
echo rm -f $(OBJECTS_ABS)
echo rm -rf $(APP_ABS)
main.m:
#import "MyExample.h"
int main(int argc, char **argv)
{
NSAutoreleasePool *autoreleasePool = [
[ NSAutoreleasePool alloc ] init
];
int returnCode = UIApplicationMain(argc, argv, [ MyApp class ]);
[ autoreleasePool release ];
return returnCode;
}
@implementation MyApp
- (void)applicationDidFinishLaunching:(NSNotificatio n *)aNotification {
window = [ [ UIWindow alloc ] initWithContentRect:
[ UIHardware fullScreenApplicationContentRect ]
];
CGRect windowRect =
[ UIHardware fullScreenApplicationContentRect ];
windowRect.origin.x = windowRect.origin.y = 0.0f;
mainView = [ [ UIView alloc ] initWithFrame: windowRect ];
[ window setContentView: mainView ];
[ window orderFront: self ];
[ window makeKey: self ];
[ window _setHidden: NO ];
}
@end
myExample.h
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface MyApp : UIApplication {
UIWindow *window;
UIView *mainView;
}
@end
myExample.m:
#import "MyExample.h"
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <CoreFoundation/CoreFoundation.h>
MyExample_Prefix:
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#endif
Denke nicht, dass das wichtig ist, aber hier die info.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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>CFBundleExecutable</key>
<string>MyExample</string>
<key>CFBundleIdentifier</key>
<string>com.Phil.MyExample</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
</dict>
</plist>
In der cygwin konsole mache ich den build folgendermaßen:
cd C:/cygwin/iphone-apps/MyExample
make