Re: Alternative to stringWithContentsOfURL

2009-10-27 Thread James Lin
ng to take up the responsibility for this one, because it works in a browser... That's why i am asking for alternatives to stringWithContentsOfURL... James On 2009/10/27, at 下午11:25, Roland King wrote: On 27-Oct-2009, at 11:16 PM, Dave Carrigan wrote: On Oct 27, 2009, at 8:11 AM, James

Alternative to stringWithContentsOfURL

2009-10-27 Thread James Lin
Hi all, I am still having the mysterious error of "Internal Error 500" message returned from stringWithContentsOfURL. I am using stringWithContentsOfURL to call a php script that add an entry to MySQL database. My ISP claims that they have removed all security restrictions on my php scr

Re: stringWithContentsOfURL with resulting error 256

2009-10-23 Thread James Lin
doing something that confuses Cocoa but which PHP and Safari handle properly. -- john On Oct 22, 2009, at 8:52 AM, Jens Alfke wrote: On Oct 22, 2009, at 7:16 AM, James Lin wrote: NSString *result = [NSString stringWithContentsOfURL:theURL encoding:NSUTF8StringEncoding error:&erro

stringWithContentsOfURL with resulting error 256

2009-10-22 Thread James Lin
Hi, I am trying to access a PHP script (which adds an entry to MySQL database) on my server with the following call: NSString *result = [NSString stringWithContentsOfURL:theURL encoding:NSUTF8StringEncoding error:&error]; However, the result comes back with an NSError as the following: E

[iPhone] In App Purchase Voodoo?

2009-10-07 Thread James Lin
Hi all... This may sound kinda weird... I've been trying to code In-App Purchase into my app. and this afternoon i've finally succeeded to the point where I can make a purchase and have the app restore return my in-app item. and it then asks me for itunes account to make a purchase...I've g

Re: [iPhone] Application running for the very first time...

2009-10-01 Thread James Lin
Thank you for the code snipet, but I am confused at the logic here... the following code will be executed EVERY time the program runs, right? NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] initWithCapacity:10]; [dictionary setObject: [NSNumber numberWithBool:YES] forKe

Re: [iPhone] Application running for the very first time...

2009-10-01 Thread James Lin
Thank you for the code snipet, but I am confused at the logic here... the following code will be executed EVERY time the program runs, right? NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] initWithCapacity:10]; [dictionary setObject: [NSNumber numberWithBool:YES] forKe

Re: [iPhone] Application running for the very first time...

2009-10-01 Thread James Lin
Can you please elaborate on this a bit more? I am already using NSUserDefaults for my preferences values. But I fail to see how this apply to determining if an Application is launched for the very first time... What do I do? Check to see if an NSUserDefault item exists? Thanks for the help..

[iPhone] Application running for the very first time...

2009-09-30 Thread James Lin
Hi all, I am wondering if there is a simple way to find out when my application is running for the VERY FIRST TIME on an iPhone? So that I can set an integer variable once only at this moment... What's the best way to do this? Thank you in advance... James __

Re: [iPhone] networking

2009-08-06 Thread James Lin
state of confusion right now, any suggestion you can give me is much appreciated... Thanx in advance... James On 2009/8/6, at 下午 10:18, Jeremy Pereira wrote: On 6 Aug 2009, at 09:27, James Lin wrote: Is this my best option given what I want to accomplish? Thanks in advance... Stepping

Re: [iPhone] networking

2009-08-06 Thread James Lin
Can you please elaborate a bit more? What technology option do I have when it comes to a "messaging server"? What's involved on the iPhone's side? Thank you in advance... James On 2009/8/6, at 下午 4:33, Keith Duncan wrote: On 6 Aug 2009, at 09:27, James Lin wrote: [.

Re: [iPhone] networking

2009-08-06 Thread James Lin
My goal: 1. 1 iPhone running my app working as a server waiting for connection from another iPhone from the "internet". 2. Another iPhone running my app working as a client connects to the server iPhone and send a string "hi, I am James". 3. The server iPhone, upon receiving this string re

Re: [iPhone] networking

2009-08-06 Thread James Lin
Sorry for the repeating question...I am just getting more and more confused instead so far... Thank you in advance... James On 2009/8/5, at 上午 2:13, Luke the Hiesterman wrote: On Aug 4, 2009, at 11:10 AM, James Lin wrote: Bonjour is for local area network, right? No, Bonjour is applicable to

Re: [iPhone] networking

2009-08-04 Thread James Lin
e given it an IP. As someone said earlier, you have to bind an IP address to a socket - it doesn't just come out of thin air. Luke On Aug 4, 2009, at 11:07 AM, James Lin wrote: I am not using CFHost... I use the CFSocketCopyAddress() on a CFSocketRef (my server socket) called TCPServ

Re: [iPhone] networking

2009-08-04 Thread James Lin
上午 2:02, glenn andreas wrote: On Aug 4, 2009, at 12:49 PM, James Lin wrote: I am trying to make the iPhone a server and a client at the same time... What I am trying to accomplish... 1. iPhone running my application opens a "server" socket and listens for incoming network conne

Re: [iPhone] networking

2009-08-04 Thread James Lin
ames On 2009/8/5, at 上午 1:52, Luke the Hiesterman wrote: Have you tried using CFHost to get your IP? Luke On Aug 4, 2009, at 10:49 AM, James Lin wrote: I am trying to make the iPhone a server and a client at the same time... What I am trying to accomplish... 1. iPhone running my application

Re: [iPhone] networking

2009-08-04 Thread James Lin
t the wall... Any ideas/suggestions are greatly appreciated... Thanx again... James On 2009/8/4, at 下午 11:50, Dave Camp wrote: On Aug 4, 2009, at 5:43 AM, James Lin wrote: Hi all, Does anyone know the limitation of the iPhone simulator when it comes to networking? Is it crippled on

Re: [iPhone] networking-is it crippled on the simulator?

2009-08-04 Thread James Lin
imulator, that means my development work has to take a break until I get my hands on an actual iPhone.. Does anyone know? Thank you in advance... James On 2009/8/4, at 下午 9:04, John C. Randolph wrote: On Aug 4, 2009, at 5:43 AM, James Lin wrote: Hi all, Does anyone know the limi

[iPhone] networking-is it crippled on the simulator?

2009-08-04 Thread James Lin
Hi all, Does anyone know the limitation of the iPhone simulator when it comes to networking? Is it crippled on the simulator? I've tried two seperate ways of opening up a "server" socket. 1. is by opening up a CFSocket 2. is by a socket wrapper class called LXSocket class obtained from goog

[iPhone] get iPhone's IP address...

2009-07-19 Thread James Lin
Hi all, I found this code snipet that's supposed to return the iPhone's IP address. I am wondering if anyone can confirm the method for me. As i am told that this method works in an actual iPhone and not on the simulator. But i won't have an iPhone until Aug 9th All i am getting in th

[iPhone] Network connection between 2 iPhones-Can GKVoiceChat be my solution?

2009-07-13 Thread James Lin
Hi all... Continuing on with my network between 2 iPhone quest... Thanks to Luke who made me aware of Game Kit and GKVoiceChat. As I am new to network programming, I need you to help me make sense of the documentation. If I am reading the GKVoiceChat documentation correctly...GKVoiceChat

Re: [iPhone] Addressbook "group" problem

2009-07-13 Thread James Lin
bottom and make some, I'm just about to!) James Lin wrote: Thank you Roland. Actually, I tried that function...but there is a problem that I can't figure out. the following is my code segment... ABAddressBookRef addressBook=ABAddressBookCreate(); CFArrayRef grpval= ABA

Re: [iPhone] Network connection between 2 iPhones

2009-07-13 Thread James Lin
27;re trying to do? Is it bluetooth (gamekit), is it internet? Do you have a central server to talk to, are you talking any high level protocols like HTTP which you can use the higher level APIs for or are you raw data on a socket? On Jul 13, 2009, at 11:52 PM, I. Savant wrote: On Jul 13, 200

Re: [iPhone] Network connection between 2 iPhones

2009-07-13 Thread James Lin
I did a quick scan of the GameKit programming guide... Just to be sure...does it only work with bluetooth? What if i need connection over the internet? The game kit guide says "It does notcover the design and implementation of networked games or applications."... Thank you again... James O

[iPhone] Network connection between 2 iPhones

2009-07-13 Thread James Lin
Hi all... I am new to network programming...so please bear with me... I am trying to program the following functionalities into my app. 1. When my app is running...it can RECEIVE network data from ANOTHER iPHONE through the network. 2. When my app is running...it can RECEIVE network data to A

Re: [iPhone] Addressbook "group" problem

2009-07-13 Thread James Lin
Hi Roland, Luke... Thank you for your pointers... the following finally works... ABRecordRef group = CFArrayGetValueAtIndex(grpval, i); NSString *groupName = (NSString *)ABRecordCopyCompositeName(group); Thank you for your pointers and help...sincerely appreciated! James _

Re: [iPhone] Addressbook "group" problem

2009-07-12 Thread James Lin
ains illusive to me :( any ideas? what's "NSCFType"? what am I doing wrong? Thank you in advance... James On 2009/7/13, at 下午 1:15, Roland King wrote: ABAddressBookCopyArrayOfAllGroups()? James Lin wrote: Hi, Sorry I didn't frame my question more clearly... The part

Re: [iPhone] Addressbook "group" problem

2009-07-12 Thread James Lin
you in advance... James On 2009/7/11, at 下午 9:36, Luke Hiesterman wrote: The group doesn't have a name when you create it. Try setting the name after creation rather than getting it. Luke Sent from my iPhone. On Jul 11, 2009, at 12:50 AM, James Lin wrote: Hi all, Anyone familiar

[iPhone] Addressbook "group" problem

2009-07-11 Thread James Lin
Hi all, Anyone familiar with the Addressbook framework? I can't seem to be able to add a "group" into the addressbook only ONCE. if i use ABRecordRef group = ABGroupCreate(); to get a handle on group, calling NSString *groupName = (NSString *)ABRecordCopyCompositeName(group); returns a NUL

[iPhone]MKAnnotation of "showUserLocation"-getting a reference to my own location pin

2009-06-18 Thread James Lin
Hi all... Anyone playing with MKMapView? I am trying to set the pin color of "my" location to be red. and set other annotations to another color. But I am having trouble getting a reference to the pin that denotes my location. because this pin is generated by "showUserLocation" and not by M

Re: [iPhone] Settings Application...need an Image Picker

2009-05-16 Thread James Lin
e your own settings embedded in your app. On May 16, 2009, at 11:44 AM, James Lin wrote: Hi, The settings application works great. However, I need to have an image selected as part of user defaults. ie, i need to have a way for the user to pick an image as an option i

[iPhone] Settings Application...need an Image Picker

2009-05-16 Thread James Lin
Hi, The settings application works great. However, I need to have an image selected as part of user defaults. ie, i need to have a way for the user to pick an image as an option item. The SettingsApplicationSchema doesn't work with images. I need to find a way to integrate User Defaults wit

[iPhone] UITableViewController headache

2009-05-10 Thread James Lin
Hi all, This is strange, i don't know what to make of it. I have a view with a TableView in it. If i use UITableViewController class, which is supposed to be the correct class to use, the tableview (which has 1 UILabel and 1 UITextField combined cells) is only correctly rendered up to cell

[iPhone] grouped tableview section title seeing double

2009-05-09 Thread James Lin
Hi, I don't know if anyone encountered the same problem. when i try to set the section title for a 1 section grouped tableview using titleForHeaderInSection, for some unknown reason, there are two styles of headers showing at the same time overlaying each other. Anyone ever encounter the

[iPhone] Grouped TableView baffling problem

2009-05-08 Thread James Lin
Hi, I have a table view with 3 grouped sections. Each section contains only one item. There is a baffling problem i don't have a clue what went wrong. if any one of the single row in any section is selected for the first time. All is well, the correct next view will get pushed without prob

[iPhone] tab bar and navigation combined...

2009-05-05 Thread James Lin
Hi list, I have a iPhone program. The main interface is Tab Bar based and consist of 3 Tab Bar views. On two of the tab bar views, I'll have a table view on each of them. Once the table view cell is clicked, I need to do a "pushview" to show details of the item selected. Basically I am do