Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
CFBundleIdentifier
main.m
HelloWorldAppDelegate.h
HelloWorldAppDelegate.m
MyView.h
MyView.m
Toolbar
Favorites bar
Status bar
Detail view
UIFont
UIFont
<Xcode>/Applications
<Xcode>
HelloWorld
MyView
MyView.m
HelloWorldAppDelegate
MyView
HelloWorldAppDelegate.m
HelloWorldAppDelegate
#import
#import "MyView.h"
application:didFinishLaunchingWithOptions:
HelloWorldAppDelegate.m
#import "HelloWorldAppDelegate.h"
#import "MyView.h"
@implementation HelloWorldAppDelegate
@synthesize window;
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch
MyView *view = [[MyView alloc] initWithFrame:[window frame]];
[window addSubview:view];
[view release];
[window makeKeyAndVisible];
return YES;
}
- (void)dealloc {
[window release];
[super dealloc];
}
@end
MyView.m
- (void)drawRect:(CGRect) rect {
NSString *hello
= @"Hello, World!";
CGPoint location = CGPointMake(10, 20);
UIFont
*font
= [UIFont systemFontOfSize:24.0];
[[UIColor whiteColor] set];
[hello drawAtPoint:location withFont:font];
}
CGPointM
10
20
;
Building ...
Compiling
error:
error:
2 errors
<project_directory>/Classes/HelloWorldAppDelegate.m (2 errors)
'MyView' undeclared (first use in this function)
'view' undeclared (first use in this function)
#import "MyView.h"
HelloWorldAppDelegate.m
Entitlements.plist
TARGET_OS_IPHONE
TARGET_IPHONE_SIMULATOR
TARGET_IPHONE_SIMULATOR
TARGET_OS_IPHONE
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#else
#import <Cocoa/Cocoa.h>
#endif
TARGET_OS_IPHONE
TargetConditionals.h
TARGET_IPHONE_SIMULATOR
-framework <framework_name>
.zip
HelloWorld.zip
HelloWorld
.xcodeproj
HelloWorld.xcodeproj
armv6
armv7
MinimumOSVersion
Info.plist
Code Signing Identity 'iPhone Developer' does not match any valid, non-expired,
code-signing certificate in your keychain.
CFBundleIdentifier
com.<organization_name>.*
com.<organization_name>.<application_name>
CFBundleIdentifier
CFBundleIdentifier
CFBundleIdentifier
com.mycompany.*
CFBundleIdentifier com.mycompany.MyApp
CFBundleIdentifier
com.mycompany.MyApp.*
CFBundleIdentifier com.mycompany.MyApp
CFBundleIdentifier
~/Library/Application
Support/iOS Simulator/<sdk_version>/Applications
Applications
4.1
4.2
Library/Preferences
Applications/<app_UUID>Library/Preferences
Computer
Certificate Signing Request
Keychain
Xcode Organizer
Development Certificate
(is stored on computer)
Digital identity
Public key
Provisioning Profile
(is stored on device)
Development certificates
Device identifiers
App ID
Debugger strip
Gutter
Debugger datatip
Toolbar
Thread List
Text editor
Status bar
Variable list
NSLog
/Applications/Utilities
NSZombieEnabled
YES
NSZombieEnabled
SenTestCase
LogicTests
LogicTests
LogicTests.h
#import <SenTestingKit/SenTestingKit.h>
#import <UIKit/UIKit.h>
@interface LogicTests : SenTestCase {
}
@end
LogicTests.m
#import "LogicTests.h"
@implementation LogicTests
- (void) testFail {
STFail(@"Must fail to succeed.");
}
@end
LogicTest.m
#import "LogicTests.h"
@implementation LogicTests
- (void) testPass {
STAssertTrue(TRUE, @"");
}
@end
<application_name>Testing
<application_name>Tests
MyAppTests.octest
MyAppTests
MyAppTests.h
#import <SenTestingKit/SenTestingKit.h>
#import <UIKit/UIKit.h>
@interface MyAppTests : SenTestCase {
}
@end
MyAppTests.m
#import "MyAppTests.h"
@implementation MyAppTests
- (void) testFail {
STFail(@"Must fail to succeed.");
}
@end
MyAppTests.m
#import "MyAppTests.h"
@implementation LogicTests
- (void) testAppDelegate {
id app_delegate = [[UIApplication sharedApplication] delegate];
STAssertNotNil(app_delegate, @"Cannot find the application delegate.");
}
@end
test...
void
- (void) test<test_case_name> {
...
// Set up, call test-case subject API.
ST...
// Report pass/fail to testing framework.
...
// Tear down.
}
setUp
tearDown
void
setUp/tearDown
- (void) setUp {
test_subject = [[[MyClass alloc] init] retain];
STAssertNotNil(test_subject, @"Could not create test subject.");
}
- (void) tearDown {
[test_subject release];
}
setUp
tearDown
<Xcode>/Applications <Xcode>
Tester
Developer
Program Portal
Tester device ID
Tester device ID
device
Tester Device
Tester
provisioning profile
Tester
provisioning profile
Tester device
Test app ID
Tester
provisioning profile
Tester
provisioning profile
Test application
Test application
iTunes
Development
certificate
<Profile_Name>.mobileprovision
iTunesArtwork
iTunesArtwork
<Application_Name>.ipa
~/Library/Logs/CrashReporter/MobileDevice
<user_name>
C:\Users\<user_name>\AppData\Roaming\Apple
computer\Logs\CrashReporter/MobileDevice
<Profile_Name>.mobileprovision
-ObjC
-all_load
main.m
// main.m
#import <UIKit/UIKit.h>
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}
HelloWorldAppDelegate.h
// HelloWorldAppDelegate.h
#import <UIKit/UIKit.h>
@interface HelloWorldAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@end
HelloWorldAppDelegate.m
// HelloWorldAppDelegate.m
#import "HelloWorldAppDelegate.h"
#import "MyView.h"
@implementation HelloWorldAppDelegate
@synthesize window;
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
MyView *view = [[MyView alloc] initWithFrame:[window frame]];
[window addSubview:view];
[view release];
[window makeKeyAndVisible];
return YES;
}
- (void)dealloc {
[window release];
[super dealloc];
}
@end
MyView.h
// MyView.h
#import <UIKit/UIKit.h>
@interface MyView : UIView {
}
@end
MyView.m
// MyView.m
#import "MyView.h"
@implementation MyView
- (id)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
// Initialization code
}
return self;
}
- (void)drawRect:(CGRect)rect {
NSString *hello
= @"Hello, World!";
CGPoint location = CGPointMake(10, 20);
UIFont
*font
= [UIFont systemFontOfSize:24];
[[UIColor whiteColor] set];
[hello drawAtPoint:location withFont:font];
}
- (void)dealloc {
[super dealloc];
}
@end
SenTestCase.h
STFail(failure_description, ...)
failure_description
nil
...
failure_description
object_1
object_2
failure_description
nil
...
failure_description
[object_1 isEqualTo:object_2]
value_1
value_2
failure_description
nil
...
failure_description
value_1
value_2
value_1
value_2
accuracy
failure_description
nil
...
failure_description
value_1
value_2
accuracy
expression
failure_description
nil
...
failure_description
expression
failure_description
nil
...
failure_description
expression
failure_description
nil
...
failure_description
expression
failure_description
nil
...
failure_description
expression
failure_description
nil
...
failure_description
expression
exception_class
failure_description
nil
...
failure_description
expression
exception_class
expression
exception_class
exception_name
failure_description
nil
...
failure_description
expression
exception_name
exception_class
expression
failure_description
nil
...
failure_description
expression
exception_class
failure_description
nil
...
failure_description
expression
exception_class
expression
exception_class
exception_name
failure_description
nil
...
failure_description
expression
exception_class
exception_name
expression
failure_description
nil
...
failure_description
expression
failure_description
nil
...
failure_description
GFWOTNXFIY.com.mycompany.MyApp
test...