Search Results

Search found 4 results on 1 pages for 'friendlydeveloper'.

Page 1/1 | 1 

  • Convert NSMutableArray to string and back

    - by Friendlydeveloper
    Hello, in my current project I'm facing the following problem: The app needs to exchange data with my server, which are stored inside a NSMutableArray on the iPhone. The array holds NSString, NSData and CGPoint values. Now, I thought the easiest way to achieve this, was to convert the array into a properly formatted string, send it to my server and store it inside some mySQL database. At this point I'd like to request my data from my server, receive the string, which represents contents of my array and then actually convert it back into a NSMutablArray. So far, I tried something like this: NSString *myArrayString = [myArray description]; Now I send this string to my server and store it inside my mySQL database. That part works really well. However, when I receive the string from my server, I have trouble converting it back into a NSMutableArray. Is there a method, which can easily convert array description back into an array? Unfortunately I couldn't find anything on that so far. Maybe my way of "serializing" the array is wrong right from the start and there is a smarter way to do this. Any help appreciated. Thanks in advance.

    Read the article

  • Apple push notifications and Emoji characters...

    - by Friendlydeveloper
    Hello, I recently found this very interesting article on APNS and Emoji characters: EASY APNS - Just for fun It contains a list with all supported Emojis. However, I couldn't get them to display in my push notifications. All I get is the code, not the image. For example, if I add \ue415 (a smiley) to my message, I never see the image, just the code. Any idea what I'm doing wrong? Thanks in advance.

    Read the article

  • UITextView refuses to change its color

    - by Friendlydeveloper
    Hello, in some cases things you'd expect to solve within a sec turn out to become a lifetime adventure. This is one of these cases :) All I wanted to do, is simply change the text color of one of my UITextViews. So far I tried: UIColor *myColor = [UIColor colorWithHue:38 saturation:98 brightness:100 alpha:1.0]; [myTextView setTextColor:myColor]; OR UIColor *myColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"colorImage.png"]]; [myTextView setTextColor:myColor]; Both seem to work fine for UILabels, but fail for UITextView elements. When I try [UIColor colorWithHue... I only get a reddish kinda color, no matter what values I choose (except values for black and white. They work). The colorWithPatternImage does not change textColor at all. Strange isn't it? I obviously must be missing something. Help is very much appreciated. Thanks in advance.

    Read the article

  • Adding images to an array memory issue

    - by Friendlydeveloper
    Hello all, I'm currently facing the following issue: My app dynamically creates images (320 x 480 pixels) and adds them to a NSMutableArray. I need those images inside that array in order to allow users to browse through them back and forth. I only need to keep the latest 5 images. So I wrote a method like below: - (void)addImageToArray:(UIImage*)theImage { if ([myMutableArray count] < 5) { [myMutableArray addObject:theImage]; } else { [myMutableArray removeObjectAtIndex:0]; [myMutableArray addObject:theImage]; } } This method basically does what it's supposed to do. However, in instruments I can see, that memory usage is permanently incrementing. At some point, even though I do not have any memory leaks, the app finally crashes. The way I see it, XCode does remove the image from my array, but does not release it. Is there a way I can make sure, that the object I want to remove from my array will also get released? Maybe my approach is completely wrong and I need to find a different way. Any help appreciated. Thanks in advance

    Read the article

1