Mobile Safari Simulator on web:
http://ipadpeek.com/
Tuesday, June 29, 2010
Friday, June 25, 2010
iOS 4
About iOS 4:
1. iOS 4 Now Available to Download
2. Updating to iOS 4? Here’s what you need to know
3. iOS 4 walkthrough
4. iOS 4 On iPhone 3G: Much Ado About Nothing
5. Download iOS 4 for iPhone 3G/3GS and iPod Touch 2G/3G [Direct download links + how to install guide]
1. iOS 4 Now Available to Download
2. Updating to iOS 4? Here’s what you need to know
3. iOS 4 walkthrough
4. iOS 4 On iPhone 3G: Much Ado About Nothing
5. Download iOS 4 for iPhone 3G/3GS and iPod Touch 2G/3G [Direct download links + how to install guide]
Xcode 4
About new Xcode:
Inside Apple's new Xcode 4 development too
Changes:
1. Single window IDE - more than "All in One" now, it will include the Interface Builder, a comparison tool, ... whatever else.
2. New LLDB debugger.
Inside Apple's new Xcode 4 development too
Changes:
1. Single window IDE - more than "All in One" now, it will include the Interface Builder, a comparison tool, ... whatever else.
2. New LLDB debugger.
Saturday, June 19, 2010
MobileMe Updated
New MobileMe looks great.
theAppleBlog already mentioned it in few recent posts:
MobileMe Gets a Makeover.
Find My iPhone: Now Available On Your iPhone.
It was a nice feature even before - firstly, it allowed me to synchronize my contacts on the phone and few computers, secondly, and, probably, the most important - it allows to send high priority messages to my phone, remotely lock ow even wipe it.
"Find my iPhone" feature almost does not work in my region - I see myself near a sea, but there is no streets around. I hope it will be fixed later.
New version looks better form the GUI perspective. For example, here is the switch between different web-applications on me.com:
One more nice feature is the Rules - in Mail I've set a Rule. I didn't find this feature in GMail or Yahoo, for example.
theAppleBlog already mentioned it in few recent posts:
MobileMe Gets a Makeover.
Find My iPhone: Now Available On Your iPhone.
It was a nice feature even before - firstly, it allowed me to synchronize my contacts on the phone and few computers, secondly, and, probably, the most important - it allows to send high priority messages to my phone, remotely lock ow even wipe it.
"Find my iPhone" feature almost does not work in my region - I see myself near a sea, but there is no streets around. I hope it will be fixed later.
New version looks better form the GUI perspective. For example, here is the switch between different web-applications on me.com:
One more nice feature is the Rules - in Mail I've set a Rule. I didn't find this feature in GMail or Yahoo, for example.
Thursday, June 17, 2010
Objective-C Tuesdays: C strings
Great articles about the c strings, NSString, CFString:
Objective-C Tuesdays: C strings
Objective-C Tuesdays: C strings
Tuesday, June 15, 2010
NSString. Write to file. Read from file.
This small program below show the simplest way to create an ASCII text file, write a string into it and read the string from the file:
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSString* lastLine = @"Beauty is truth, truth beauty";
NSString* fileName = @"GrecianUrn.txt";
NSString* homeDir = NSHomeDirectory();
NSString* fullPath = [homeDir stringByAppendingPathComponent:fileName];
NSError* error = nil;
[lastLine writeToFile:fullPath atomically:NO encoding:NSASCIIStringEncoding error:&error];
NSStringEncoding encoding;
NSString* contents = [NSString stringWithContentsOfFile:fullPath usedEncoding:&encoding
error:&error];
NSLog(@"Content of '%@': %@", fileName, contents);
[pool drain];
return 0;
}
Saturday, June 12, 2010
Objective-C. Forwarding Messages.
Forwarding messages. It's an absolutely new feature for me in Object-Oriented Programming. I found this thing working in Objective-C (thanks to the book - on the left).
#import <Foundation/Foundation.h>And here is the output:
@interface Cat : NSObject
- (void) meow;
@end
@interface Dog : NSObject
- (void) woof;
@end
@implementation Cat
- (void) meow
{
NSLog( @"%@: Meow", [self className] );
}
@end
@implementation Dog
- (void) woof
{
NSLog( @"%@: woof", [self className] );
}
- (NSMethodSignature*) methodSignatureForSelector:(SEL)selector
{
NSString* name = NSStringFromSelector( selector );
NSLog( @"-[%@: methodSignatureForSelector: %@]", [self className], name );
if ([Cat instancesRespondToSelector: selector])
return [Cat instanceMethodSignatureForSelector: selector];
return [super methodSignatureForSelector: selector];
}
- (void) forwardInvocation:(NSInvocation *)anInvocation
{
NSString* name = NSStringFromSelector( anInvocation.selector );
NSLog( @"-[%@: forwardInvocation: %@]", [self className], name );
id theCat = [[Cat alloc] init];
NSLog( @"Forwarding '%@' to %@", name, theCat );
[anInvocation invokeWithTarget: theCat];
[theCat release];
}
@end
int main()
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
id dog = [[Dog alloc] init];
[dog woof];
[dog meow];
[dog release];
[pool drain];
return 0;
}
Running…
Dog: woof
-[Dog: methodSignatureForSelector: meow]
-[Dog: forwardInvocation: meow]
Forwarding 'meow' to
Cat: Meow
Friday, June 11, 2010
64-bit Objective-C
On 64-bit you can use properties to generate both accessor methods and the instance variable itself. This code compiles and works on Snow Leopard:
Here is the console:
#import <Foundation/Foundation.h>
@interface Test : NSObject
@property (retain) NSString *name;
@end
@implementation Test
@synthesize name;
@end
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
Test *test = [[Test alloc] init];
[test setName: @"TheName"];
NSLog(@"Name is %@\n", [test name]);
[pool drain];
return 0;
}
Here is the console:
Program loaded.
run
[Switching to process 2963]
Running…
2010-06-12 00:42:30.308 Test64[2963:a0f] Name is TheName
Debugger stopped.
Program exited with status value:0.
Tuesday, June 8, 2010
Cocoa and Objective-C Up and Running.
I've read already many book about Objective-C and didn't think that I can find something new in this one. I was wrong. It's really a great book.
For example:
[object method];
[object methodWithInput: inputValue];
Objective-C is a dynamic language, so technically you are not calling a method directly when you use this syntax; you are actually sending a message. Calling a method is basically issuing an order, whereas sending a message is more like making a request.
For example:
[object method];
[object methodWithInput: inputValue];
Objective-C is a dynamic language, so technically you are not calling a method directly when you use this syntax; you are actually sending a message. Calling a method is basically issuing an order, whereas sending a message is more like making a request.
Saturday, June 5, 2010
AppleScript. Automator.
Two nice articles on Mac.AppStorm:
1. Automator: The Ultimate Automation Assistant
2. Advanced AppleScript Techniques
Friday, June 4, 2010
Objective-C classes at runtime
Great article:
Obj-C Optimization: Allocation Basics & Foundation
Obj-C Optimization: Allocation Basics & Foundation
AppleScript. Hello, World!
You can find AppleScript Editor in the folder Utilities of Applications:
Type "Hello":
Press Compile and then Run - see "Hello" in the result window:
Let's "complicate" the script. Type:
display alert "Hello"
Press Compile and Run. You see a simple alert with one Ok button on the screen:
Let's make an application from it. In the File menu select "Save as". You will see this save dialog:
Select "Application" in the File Format combo box. Set a name, for example Hello. Set a path - I set the desktop:
Now on the desktop I see my Hello application. When I click on it, I see my alert:
In the end of this post I'd like to show a less useless and a bit funny example. You can use AppleScript editor as a calculator. Simply type something you need to calculate, compile and run it:
Of course you can arrange it as a script:
This book below contains a nice section about AppleScript:
Type "Hello":
Press Compile and then Run - see "Hello" in the result window:
Let's "complicate" the script. Type:
display alert "Hello"
Press Compile and Run. You see a simple alert with one Ok button on the screen:
Let's make an application from it. In the File menu select "Save as". You will see this save dialog:
Select "Application" in the File Format combo box. Set a name, for example Hello. Set a path - I set the desktop:
Now on the desktop I see my Hello application. When I click on it, I see my alert:
In the end of this post I'd like to show a less useless and a bit funny example. You can use AppleScript editor as a calculator. Simply type something you need to calculate, compile and run it:
Of course you can arrange it as a script:
display alert 45 + 16 * 2 / 3
This book below contains a nice section about AppleScript:
Subscribe to:
Posts (Atom)