Erica Sadun


Erica Sadun. iPhone. iPod touch. Macintosh. and More.

3.0 Cookbook Sample Code…

Erica Sadun | 3:57 pm | July 8, 2009 | Sample Code, 3.0, Test Requests, Books

…is up at github. Feedback welcome.

21 Comments »

Comment by rodney_viper | July 8, 2009 | 4:52 pm

Hi,
I’m new in iPhone development so thanks for theses samples.
However I’m trying to execute the project “13b - better curls” and here the result :
http://img40.imageshack.us/i/picture1ikd.png/
the background is present when I launch the app but disappear quickly. If I press curl, the button disappear also.


Comment by Erica Sadun | July 8, 2009 | 4:58 pm

You’ll want to compile these for 3.0 (or at least 2.2.1)


Comment by rodney_viper | July 8, 2009 | 5:54 pm

thank you it works


Comment by flo | July 25, 2009 | 8:22 am

Erica, thanks for the code samples! I was recently trying to get used to push notifications (C16 - Push). I added two devices via pushutil. However, when I send the notification, only the first device in ‘apns.devices’ receives it. I already have swapped the device tokens to see if it always happens and it does. Any idea why this happens and what I can do about it? Thanks in advance!


Comment by flo | July 28, 2009 | 8:06 am

Okay, I found out, that it seems to be intended that the notification is sent to only one device… :-) In that case my question is what do I have to change in the pushtweet-project to make it send the notification to all devices that are saved in ‘apns.devices’? Thanks in advance!


Comment by Erica Sadun | July 28, 2009 | 8:41 am

Read in the dictionary from apns.devices and then iterate through the entries


Comment by flo | July 28, 2009 | 8:58 am

Thanks for your help, Erica! I am pretty new to developing with xcode (actually to developing at all) and more than happy to have push notifications working at all… I know I’m asking a lot but could you please provide me with the necessary code for pushtweet to get it working? That would be great!!! My e-mail is fschimanke@web.de. Thanks a lot!!!


Comment by Erica Sadun | July 28, 2009 | 9:26 am

With my deepest apologies, my work and family commitments do not allow me the time to help with your request.


Comment by flo | July 28, 2009 | 10:54 am

I really understand that. Thanks anyway! Maybe I’ll find a solution by myself. I’ll let you know when I got it up and running! :-)


Comment by ThinkMud | July 30, 2009 | 8:02 am

I can not seem to download the new source code.
In IE8, nothing happens when I click the download link, and in FireFox 3.5 it just opens a message saying:

Download erica/iphone-3.0-cookbook- at master

Hardcore Archiving Action

But that never goes away and nothing gets downloaded.

Any help would be greatly appreciated!!

Also thanks for an awesome book!


Comment by Erica Sadun | July 30, 2009 | 8:09 am

http://code.google.com/p/git-osx-installer/

You’ll probably need to use git then. I know the download problem is semi-dire.

There are GUI versions too:
http://stackoverflow.com/questions/83789/what-is-the-best-git-gui-on-osx


Comment by ThinkMud | July 30, 2009 | 8:51 am

awesome! the command line tool worked, so if anyone else is having issues, just download git, and use this from the command line:

git clone

example:

git clone git://github.com/erica/iphone-3.0-cookbook-.git /Users/buck/Git/iphone-cookbook

I’m assuming that clone is fine here, since we just want a copy and will not be updating.

thanks for the quick response.


Comment by galileyous | August 2, 2009 | 6:01 pm

Hi im new too in iphone development. Im trying to modify the xmlParser example for generic xml. Ive this code: http://pastie.org/pastes/568210
the problem is in the rootview, when i use the tableview methods for create the table, the key value of TreeNode disapears or its invalid. It is posible some memory problems? My mail is galileyous@hotmail.com. Thank you.


Comment by flo | August 6, 2009 | 7:56 am

Well, I’ve found another workaround for my problem described above. I’m doing it all with PHP now. Thanks again, Erica, for pushing me in the right direction!


Comment by iPapaya | October 12, 2009 | 2:03 pm

aloha from Kauai, Erica

I have purchased your first iPhone Developer’s Cookbook and I want to thank you for providing this great resource. I’m just starting out and it has been relly helpful.

I was looking at your 3.0 cookbook rough cut on Safari Books, particularly Creating Custom Xcode Templates, and I have a question.

I have Xcode 3.1.4 and I cannot find the Library/Application Support/Developer/Shared/Xcode folder. Is this an error or do I have a downrev SDK… I just downloaded about a month ago. Thanks in advance!

neal mathur


Comment by Erica Sadun | October 12, 2009 | 2:05 pm

You’ll need to create that folder, and then copy in the templates per the instructions


Comment by iPapaya | October 12, 2009 | 4:02 pm

thank you- got it


Comment by vivas | October 23, 2009 | 11:06 am

Hi Erica,

I’m looking forward to the second edition of the cookbook, I am a proud owner of the first edition.

I am reviewing the Address Book samples (CH 18) .
Question:
1. in CH 18, example 08 (Unknown Controller) is it possible to control the navigation bar tint color of the Address Book view that opens when the “Create New Contact” button is clicked? The Address Book nav bar is the default blue while I tend to use custom tint colors in my apps.

2. in the same example (08) how could one create a ‘new’ field (ie. title or phone ext.) . I have fields in my SQLite db that do not fall under any pre-defined Address Book dictionaries so I would like to hold that data in a ‘new’ dictionary.

// For example
NSArray *ext = [NSArray arrayWithObject:[ABContact dictionaryWithValue: my.value
andLabel:(CFStringRef) @”ext”]];
contact.nonexistantDictionaries = ext;

That’s it. Thanks for your time.

Regards,
Vivas


Comment by jluckyiv | November 14, 2009 | 7:04 am

Erica, your code from Chapter 19, Queried Color List, saved me this week. I kept getting a crash in my app when I scrolled after searching with the search bar. Your code worked almost perfectly as a fix. I don’t know if there’s a small a bug in your code, but here’s what I found:

When you run the app, search works perfectly. However, if you scroll your results (or click Search to resignFirstResponder), then touch the Cancel button without clearing the searchBar text, the TableView doesn’t update correctly and the app crashes on scroll (NSRangeException). This bug only occurs if you don’t scroll (or otherwise resignFirstResponder) after the search without manually clearing the searchBar text before hitting Cancel.

I couldn’t figure out what caused this, but I found a solution (I think).

- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar {
[self.searchBar setText:@”"];
[self performFetch];
}

Now the app seems to deal with the Cancel button correctly.

Thanks again for the Code. I’ll buy the 3.0 book as soon as it’s out in electronic format!


Comment by jluckyiv | November 14, 2009 | 7:14 am

Correction: This bug only occurs if you _do_ scroll (or otherwise resignFirstResponder) after the search without manually clearing the searchBar text before hitting Cancel.


Comment by nithinshriyan | September 29, 2010 | 11:08 pm

my xml output is as below. i want to store different item in different array at xcode. how can i do tat using xml parser. pls help

?

5
ddd
ccc
sandyss@gmail.com
2000

?

6
san
prabhu
sandeepa.prabhu@gmail.com
136353
744445

?

1
ccc
sss
sandeep.prabhu124@gmail.com
1000
234

?

139353

?

744679


Comments RSS.

Leave a comment

You must be logged in to post a comment.

Previous and Next Entry

« Testing | 3.0 Headers »

wordpress | sheepdip design by mahud © 2007