Posts tagged Cocoa Touch
XCode: Modal windows – Google maps
Jul 18th
From time to time, you’ll need to show in your iPhone application a view over the entire application without navigating and destroying your workflow of the application. I’ll present the mechanism of modal windows as it is implemented in Cocoa Touch.
Lets take a real case: you have a view in which you want to input an address. Near the address you have a button which will show the user the Map centered on the specific address that he inputted. How this can be implemented?
The answer is quite simple: you need to declare the view from which you launch the modal view as <UINavigationBarDelegate> in the header file (.h for newbies), like this:
@interface CtrlAddEvtView1 : UIViewController <UINavigationBarDelegate>
This way, the view will know “magically” how to interact with children views.
Processing NSDate into an ISO8601 string
Jul 6th
During the CSCW Lab, where I had the experience of working on iPhone, I had to connect to a XML RPC server. Some of the parameters of the request had to be formatted as ISO8601 standard. After some reading, I end up using the following code, managing both the conversion of a NSDate to NSString and a NSString to a NSDATE using the above format:
NSString –> NSDate
-(NSString *) strFromISO8601:(NSDate *) date {
static NSDateFormatter* sISO8601 = nil;
if (!sISO8601) {
sISO8601 = [[NSDateFormatter alloc] init];
NSTimeZone *timeZone = [NSTimeZone localTimeZone];
int offset = [timeZone secondsFromGMT];
NSMutableString *strFormat = [NSMutableString stringWithString:@"yyyyMMdd'T'HH:mm:ss"];
offset /= 60; //bring down to minutes
if (offset == 0)
[strFormat appendString:ISO_TIMEZONE_UTC_FORMAT];
else
[strFormat appendFormat:ISO_TIMEZONE_OFFSET_FORMAT, offset / 60, offset % 60];
[sISO8601 setTimeStyle:NSDateFormatterFullStyle];
[sISO8601 setDateFormat:strFormat];
}
return[sISO8601 stringFromDate:date];
}
Apple’s Xcode : symbol(s) not found at Line Location Tool:0
May 13th
I am a begginer in XCode. My first real application for iPhone requires connection to a webservices. Since I wanted to use RPC XML or Soap, I searched on internet and found few examples (Apple programmers aren’t so into code sharing) to implement my requests. I want to mention that since the app is in the stage of proof of concept, the code is still not structured in classes separating the data and business layers as should.
So I took the example from CocoaDev and expected to run flawlessly.
But after pasting the code in my application and build it, a lot of unknown errors started to show:
iPhone Startup Tutorial
May 11th
This is the start of all iPhone Developers. It will be an extremely brief tutorial meant just for those which are at the absolute start of iPhone development.
First checks:
1. System requirements: verify if the iPhone sdk needs are met.
2. Go to Apple’s iPhone Developer Center , then download the SDK.
3. As you’ll need some experience and code to work on, download the Hello World sample application.
4. Double click (gotcha!) on the the Hello World project file (the .xcodeproj).
5. Alternatively, you can use the research assistant to increase your knowledge about the iPhone libraries.
6. Optional, but really recommended: look deeply into all source code examples that you can find and use the research assistant often.
Take a big breath and … just start!
Good luck
Baby step into Apple’s iPhone programming – Cocoa Touch
May 10th
I just started the most interesting lab of my life : Programming Apple’s iPhone using a MacBook with Cocoa Touch.It is held in Frauhover FIT, under Prof. Dr. Wolfgang Prinz and Dr. Wolfgang Gräther. In this lab we will start develop an iPhone application using Usability principles, Apple’s User interface Guides.
For me it’s the best opportunity to take a peak into the neighbor’s( Apple’s
) garden. For long time I was just curious about their technology and ways to program. But I lacked the hardware, because you can develop for Mac and iPhone only in MacBooks, Macs and obviously need an iPhone for testing.
So I want to share my experience as a newbie into Apple stuff. More >