Search Results

Search found 236 results on 10 pages for 'mystify'.

Page 6/10 | < Previous Page | 2 3 4 5 6 7 8 9 10  | Next Page >

  • How to compensate the flipped coordinate system of core graphics for easy drawing?

    - by mystify
    It's really a pain, but always when I draw an UIImage in -drawRect:, it's upside-down. When I flip the coordinates, the image draws correctly, but at the cost of all other CG functions drawing "wrong" (flipped). What's your strategy when you have to draw images and other things? Is there any rule of thumb how to not get stuck in this problem over and over again? Also, one nasty thing when I flip the y-axis is, that my CGRect from the UIImageView frame is wrong. Instead of the origin appearing at 10,10 upper left as expected, it appears at the bottom. But at the same time, all those normal line drawing functions of CGContext take correct coordinates. drawing a line in -drawRect with origin 10,10 upper left, will really start at upper left. But at the same time that's strange, because core graphics actually has a flipped coordinate system with y 0 at the bottom. So it seems like something is really inconsistent there. Drawing with CGContext functions takes coordinates as "expected" (cmon, nobody thinks in coordinates starting from bottom left, that's silly), while drawing any kind of image still works the "wrong" way. Do you use helper methods to draw images? Or is there anything useful that makes image drawing not a pain in the butt?

    Read the article

  • Does "opening a file" mean loading it completely into memory?

    - by mystify
    There's an AudioFileOpenURL function which opens an file. With AudioFileReadPackets that file is accessed to read packets. But one thing that stucks in my brain is: Does AudioFileOpenURL actually load the whole monster into memory? Or is that a lightweight operation? So is it possible to read data from a file, only a specific portion, without having the whole terabytes of stuff in memory?

    Read the article

  • How to listen to that property?

    - by mystify
    @constant kAudioSessionProperty_AudioInputAvailable A UInt32 with a value other than zero when audio input is available. Use this property, rather than the device model, to determine if audio input is available. A listener will notify you when audio input becomes available. For instance, when a headset is attached to the second generation iPod Touch, audio input becomes available via the wired microphone. So, if I wanted to get notified about kAudioSessionProperty_AudioInputAvailable, how would I do that?

    Read the article

  • Does -localizedDescription of NSError return the actual localized string, or does it return a key fo

    - by mystify
    Must I do something like this? NSString *errorDescription = [error localizedDescription]; NSString *errorInfoStr = NSLocalizedString(errorDescription, nil); Or do I use NSLocalizedString already when populating the userInfo dictionary with the NSLocalizedDescriptionKey key and value? So the value for that is not actually a key for NSLocalizedString, but it is the actual localized string ready to show up on screen?

    Read the article

  • How to make a macro which gives back a string into the source code?

    - by mystify
    Example: I want to do this: METHODNAME(5) { // do something } which results in: - (void)animationStep5 { // do something } Is there any way to do this? Basically, what I need is a way to generate a real source code string before the program is compiled, so the compiler does see - (void)animationStep5... Or maybe there's something different than a macro, which can help here to auto-generate method names (not at run-time)?

    Read the article

  • How to respond to any kind of interruption?

    - by mystify
    My app is playing a pretty complex animation. It's like a flipbook. What I do is: I have a huge loop with selectors, and after every delayed call the next one is called. Now someone calls the user and the device suddenly shows up this fat green status bar and maybe some big pick-up-the-phone-call overlay. Or: The alarm clock rings, and a big alert sheet appears in front of just about everything. It would be great to just pause the whole animation in case of ANY interruption. Probably I've also missed like 5 more possible interruptions. How are you doing that? How do you get notified for all interruptions and then call one single -stopEverything method?

    Read the article

  • How to persist and load an object which conforms to NSCoding protocol?

    - by mystify
    I have made an class which conforms to the NSCoding protocol and does all the encode and decode stuff. For my app, I simply want to persist an object from that class to the device and the next time when the app launches, I want to load that object back into memory. Basically it's just an class which holds some user input information. For example the user starts writing a text but then quits the app. Next time I want to load that data object. I guess I need NSKeyedArchiver? Is there a good tutorial on this? How do I do that?

    Read the article

  • Why do my Xcode default font starts to look ugly after some time, until I restart?

    - by mystify
    I plugged in an external monitor. All resolutions match perfectly. MacBookPro LCD is closed. After about 10 minutes my fonts in Xcode start to look very bad. Only in Xcode. When I restart the mac and don't use an external monitor, fonts look all right again. When I attach the monitor again, fonts look nice. Then I close XCode and reopen it: Fonts suck. All other fonts look great. It seems like Xcode isn't antialiasing them properly after something happens. For my observation it happens when I quit and reopen Xcode while an external monitor is in use. Only way to fix it then is to completely reboot. Is there a fix for this problem?

    Read the article

  • Easy way to open the Mail application with an pre-defined message subject and body?

    - by mystify
    In my app the user generates text content. I want to enable the user to launch the Mail application, which then should contain a specified subject and message body. Like: You write a poem in my app and then want to send it to your new girlfriend. So you tap a mail icon and the Mail app opens, containing already an subject and message body with your poem inside. Someone said there is a kind of URL mechanism for that?

    Read the article

  • Is there a faster way to draw text?

    - by mystify
    Shark complains about a big performance hit with this line, which takes like 80% of CPU time. I have a counter that is updated very frequently and performance seriously sucks. It's an custom UILabel subclass with -drawRect: implemented. Every time the counter value changes, this is used to draw the new text: [self.text drawInRect:textRect withFont:correctedFont lineBreakMode:self.lineBreakMode alignment:self.textAlignment]; When I comment this line out, performance rocks. Its smooth and fast. So Shark isn't wrong about this. But what could I do to improve this? Maybe go a level deeper? Does that make any sense? Probably drawing text is really so incredible heavy...?

    Read the article

  • How to accommodate for the different screen resolution of iPhone 4?

    - by mystify
    This is a programming question! Read on before you vote to close! According to Apple, iPhone 4 has a new screen resolution: 3.5-inch (diagonal) widescreen Multi-Touch display 960-by-640-pixel resolution at 326 ppi This little detail affects our apps in a heavy way. Most of the demo apps on the net have one thing in common: They position views in the believe that the screen has a fixed size of 320 x 480 pixels. So what most -if not all- developers do is: They designed everything in such a way, that a touchable area is -for example- 50 x 50 pixels big. Just enough to tap it. Things have been positioned relative to the upper left, to reach a specific position on screen - let's say the center, or somewhere at the bottom. Edit: It seems Apple has integrated an switch that allows to tell if an app is highRes or not. Nice. When we develop high-resolution apps, probably they won't work on older devices. And if they did, they would suffer a lot from 4-times the size of any image, having to scale them down in memory. This is community wiki. Just add anything that you think is relevant to this huge problem (constant screen res was one of the main reasons why I didn't go for Android!!).

    Read the article

  • How to make an custom button with an self-stretching image?

    - by mystify
    I slightly remember that there is an class which is capable of stretching an image in such a way, that the first x pixels and the last y pixels won't get stretched. For example if you have an button image with round corners, you would want those round corners to stay intact while the middle part of that image gets stretched.

    Read the article

  • How to reset the context to the original rectangle after clipping it for drawing?

    - by mystify
    I try to draw a sequence of pattern images (different repeated patterns in one view). So what I did is this, in a loop: CGContextRef context = UIGraphicsGetCurrentContext(); // clip to the drawing rectangle to draw the pattern for this portion of the view CGContextClipToRect(context, drawingRect); // the first call here works fine... but for the next nothing will be drawn CGContextDrawTiledImage(context, CGRectMake(0, 0, 2, 31), [img CGImage]); I think that after I've clipped the context to draw the pattern in the specific rectangle, I cut out a snippet from the big canvas and the next time, my canvas is gone. can't cut out another snippet. So I must reset that clipping somehow in order to be able to draw another pattern again somewhere else? Edit: In the documentation I found this: CGContextClip: "... Therefore, to re-enlarge the paintable area by restoring the clipping path to a prior state, you must save the graphics state before you clip and restore the graphics state after you’ve completed any clipped drawing. ..." Well then, how to store the graphics state before clipping and how to restore it?

    Read the article

  • What does that +0100 value mean in NSDate?

    - by mystify
    When I look at an NSDate value in the debugger, I get something like this: 1.4.2010 22:01:47 +0100 I don't get it what this +0100 is good for. Sometimes it is +0200. Is that supposed to be the time zone or something like that? What's it exactly? How does it affect the "since reference date" value?

    Read the article

  • Is there better documentation then the original OpenAL docs? [closed]

    - by mystify
    OpenAL is such a huge thing, and the documentation doesn't tell what values are acceptable for properties. That's really bad. I'm using the document: "OpenAL_Programmers_Guide.pdf" Whenever I look up a property I'm left in the dark what value might be ok. For example, take AL_PITCH. What value? Maybe someone wrote a better one? Or is there something like a wiki place with more details?

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10  | Next Page >