ˇ@

Home 

2014/10/15 ¤U¤Č 10:11:30

iphone Programming Glossary: mode

Retrieving a pixel alpha value for a UIImage

http://stackoverflow.com/questions/1042830/retrieving-a-pixel-alpha-value-for-a-uiimage

translate between UIKit coordinates and Core Graphics coordinates. However after setting the blend mode my alpha values were what I expected CGContextSetBlendMode context kCGBlendModeCopy iphone uikit core.. in UIKit it points down. See the docs . Edit after reading code You also want to set the blend mode to replace before drawing the image since you want the image's alpha value not the one which was in..

How would I tint an image programatically on the iPhone?

http://stackoverflow.com/questions/1117211/how-would-i-tint-an-image-programatically-on-the-iphone

like to tint an image with a color reference. The results should look like the Multiply blending mode in Photoshop where whites would be replaced with tint I will be changing the color value continuously... then overlay it with a rectangle filled with the color you want along with the proper blending mode something like this void drawRect CGRect area CGContextRef context UIGraphicsGetCurrentContext CGContextSaveGState.. context Draw picture first CGContextDrawImage context self.frame self.image.CGImage Blend mode could be any of CGBlendMode values. Now draw filled rectangle over top of image. CGContextSetBlendMode..

Cropping a UIImage

http://stackoverflow.com/questions/158914/cropping-a-uiimage

seen in the album view of the Photos app. I know I could use a UIImageView and adjust the crop mode to achieve the same results but these images are sometimes displayed in UIWebViews . I've started to..

Is there a documented way to set the iPhone orientation?

http://stackoverflow.com/questions/181780/is-there-a-documented-way-to-set-the-iphone-orientation

to support device rotation in certain views but other don't particularly make sense in Landscape mode so as I swapping the views out I would like to force the rotation to be set to portrait. There is an.. implemented shouldAutorotateToInterfaceOrientation for all views but if the user is in landscape mode in View 1 and then switches to View 2 I want to force the phone to rotate back to Portrait. iphone..

Exit application in iOS 4.0

http://stackoverflow.com/questions/3097244/exit-application-in-ios-4-0

accepted. now everything changed in iOS4.0 clicking the home button puts your app in a suspended mode multitasking .. and I think there should be a clear way for the user to exit the app like an exit button...

NSDictionary with ordered keys

http://stackoverflow.com/questions/376090/nsdictionary-with-ordered-keys

How to customize the background/border colors of a grouped table view cell?

http://stackoverflow.com/questions/400965/how-to-customize-the-background-border-colors-of-a-grouped-table-view-cell

itself in the appropriate colors. This view needs to be able to draw the borders in 4 different modes rounded on the top for the first cell in a section rounded on the bottom for the last cell in a section.. 4 corners for sections that contain one cell. Unfortunately I couldn't figure out how to have this mode set automatically so I had to set it in the UITableViewDataSource's cellForRowAtIndexPath method. It's..

iPhone app in landscape mode

http://stackoverflow.com/questions/402/iphone-app-in-landscape-mode

app in landscape mode What's the best way to create an iPhone application that runs in landscape mode from the start regardless.. app in landscape mode What's the best way to create an iPhone application that runs in landscape mode from the start regardless of the position of the device Both programmatically and using the Interface..

Lock-down iPhone/iPod/iPad so it can only run one app

http://stackoverflow.com/questions/5011774/lock-down-iphone-ipod-ipad-so-it-can-only-run-one-app

share improve this question It is possible to put an iPad or iPhone into 'Store Demo' mode so that the home button and swipe to home gesture is disabled. If you have seen the iPads in the Apple..

CADisplayLink OpenGL rendering breaks UIScrollView behaviour

http://stackoverflow.com/questions/5944050/cadisplaylink-opengl-rendering-breaks-uiscrollview-behaviour

looks horrible . One temporary fix has been to use NSRunLoopCommonModes instead of the default run mode but unfortunately this breaks some aspects of scroll view behaviour on certain phones I'm testing on.. the CADisplayLink and the UIScrollView or know how to fix the UIScrollView working in other run modes Thanks in advance Promised links to similar questions UIScrollView broken and halts scrolling with..

UIImage: Resize, then Crop

http://stackoverflow.com/questions/603907/uiimage-resize-then-crop

rest to the width. I'm working in landscape so might not have noticed any deficiencies in portrait mode. Here's my code it's part of a categeory on UIImage. Target size in my code is always set to the full..

How to programmatically determine iPhone interface orientation?

http://stackoverflow.com/questions/634745/how-to-programmatically-determine-iphone-interface-orientation

this doesn't tell us whether it's flat displaying an interface oriented in portrait or landscape mode. Is there a way to find the current orientation of the GUI in cases where the device is returning ambiguous..

How do I get a background location update every n minutes in my iOS application?

http://stackoverflow.com/questions/6347503/how-do-i-get-a-background-location-update-every-n-minutes-in-my-ios-application

this with the help of the Apple Developer Forums. I did the following Specify location background mode Use an NSTimer in the background by using UIApplication beginBackgroundTaskWithExpirationHandler In..

Store orientation to an array - and compare

http://stackoverflow.com/questions/6368618/store-orientation-to-an-array-and-compare

attitude.yaw I'm thinking that I could store these values into an array if the user is in record mode. And when the user tries to replicate that movement I'm could compare the replicated movement array..

Learning OpenGL ES 1.x

http://stackoverflow.com/questions/72288/learning-opengl-es-1-x

learn that via other means and forget about all things that are old cruft display lists immediate mode things that are in OpenGL but are not directly related to just drawing triangles . Basically unlearn..

Retrieving a pixel alpha value for a UIImage

http://stackoverflow.com/questions/1042830/retrieving-a-pixel-alpha-value-for-a-uiimage

suggestion was key to this. I did not in fact need to translate between UIKit coordinates and Core Graphics coordinates. However after setting the blend mode my alpha values were what I expected CGContextSetBlendMode context kCGBlendModeCopy iphone uikit core graphics quartz graphics share improve this question .. question Yes CGContexts have their y axis pointing up while in UIKit it points down. See the docs . Edit after reading code You also want to set the blend mode to replace before drawing the image since you want the image's alpha value not the one which was in the context's buffer before CGContextSetBlendMode context kCGBlendModeCopy..

How would I tint an image programatically on the iPhone?

http://stackoverflow.com/questions/1117211/how-would-i-tint-an-image-programatically-on-the-iphone

would I tint an image programatically on the iPhone I would like to tint an image with a color reference. The results should look like the Multiply blending mode in Photoshop where whites would be replaced with tint I will be changing the color value continuously. Follow up I would put the code to do this in my ImageView's.. In the drawRect method you'll want to draw the image first then overlay it with a rectangle filled with the color you want along with the proper blending mode something like this void drawRect CGRect area CGContextRef context UIGraphicsGetCurrentContext CGContextSaveGState context Draw picture first CGContextDrawImage.. CGContextRef context UIGraphicsGetCurrentContext CGContextSaveGState context Draw picture first CGContextDrawImage context self.frame self.image.CGImage Blend mode could be any of CGBlendMode values. Now draw filled rectangle over top of image. CGContextSetBlendMode context kCGBlendModeMultiply CGContextSetFillColor context..

Cropping a UIImage

http://stackoverflow.com/questions/158914/cropping-a-uiimage

a small square representation of an image similar to what's seen in the album view of the Photos app. I know I could use a UIImageView and adjust the crop mode to achieve the same results but these images are sometimes displayed in UIWebViews . I've started to notice some crashes in this code and I'm a bit stumped. I've..

Is there a documented way to set the iPhone orientation?

http://stackoverflow.com/questions/181780/is-there-a-documented-way-to-set-the-iphone-orientation

set the iPhone orientation I have an app where I would like to support device rotation in certain views but other don't particularly make sense in Landscape mode so as I swapping the views out I would like to force the rotation to be set to portrait. There is an undocumented property setter on UIDevice that does the trick.. in View 1 but only portrait in View 2. I have already implemented shouldAutorotateToInterfaceOrientation for all views but if the user is in landscape mode in View 1 and then switches to View 2 I want to force the phone to rotate back to Portrait. iphone objective c cocoa touch share improve this question This..

Exit application in iOS 4.0

http://stackoverflow.com/questions/3097244/exit-application-in-ios-4-0

guide that programmatically exiting the application was not accepted. now everything changed in iOS4.0 clicking the home button puts your app in a suspended mode multitasking .. and I think there should be a clear way for the user to exit the app like an exit button. is it now OK with apple and how can it be done iphone..

NSDictionary with ordered keys

http://stackoverflow.com/questions/376090/nsdictionary-with-ordered-keys

How to customize the background/border colors of a grouped table view cell?

http://stackoverflow.com/questions/400965/how-to-customize-the-background-border-colors-of-a-grouped-table-view-cell

to a custom UIView that draws the border and background itself in the appropriate colors. This view needs to be able to draw the borders in 4 different modes rounded on the top for the first cell in a section rounded on the bottom for the last cell in a section no rounded corners for cells in the middle of a section.. for cells in the middle of a section and rounded on all 4 corners for sections that contain one cell. Unfortunately I couldn't figure out how to have this mode set automatically so I had to set it in the UITableViewDataSource's cellForRowAtIndexPath method. It's a real PITA but I've confirmed with Apple engineers that..

iPhone app in landscape mode

http://stackoverflow.com/questions/402/iphone-app-in-landscape-mode

app in landscape mode What's the best way to create an iPhone application that runs in landscape mode from the start regardless of the position of the device Both programmatically and.. app in landscape mode What's the best way to create an iPhone application that runs in landscape mode from the start regardless of the position of the device Both programmatically and using the Interface Builder. iphone objective c share improve this question..

Lock-down iPhone/iPod/iPad so it can only run one app

http://stackoverflow.com/questions/5011774/lock-down-iphone-ipod-ipad-so-it-can-only-run-one-app

doc uid TP40010206 CH1 SW4 iphone security ipad ipod jailbreak share improve this question It is possible to put an iPad or iPhone into 'Store Demo' mode so that the home button and swipe to home gesture is disabled. If you have seen the iPads in the Apple Store running the smart sign apps then you will know what..

CADisplayLink OpenGL rendering breaks UIScrollView behaviour

http://stackoverflow.com/questions/5944050/cadisplaylink-opengl-rendering-breaks-uiscrollview-behaviour

from firing until the user has finished scrolling which looks horrible . One temporary fix has been to use NSRunLoopCommonModes instead of the default run mode but unfortunately this breaks some aspects of scroll view behaviour on certain phones I'm testing on the 3GS and simulator seem to work fine while the iPhone4 and.. . Does anyone know how I could get around this clash between the CADisplayLink and the UIScrollView or know how to fix the UIScrollView working in other run modes Thanks in advance Promised links to similar questions UIScrollView broken and halts scrolling with OpenGL rendering related CADisplayLink NSRunLoop Animation in..

UIImage: Resize, then Crop

http://stackoverflow.com/questions/603907/uiimage-resize-then-crop

that fits once scaled and then crop each end to fit the rest to the width. I'm working in landscape so might not have noticed any deficiencies in portrait mode. Here's my code it's part of a categeory on UIImage. Target size in my code is always set to the full screen size of the device. @implementation UIImage Extras..

How to programmatically determine iPhone interface orientation?

http://stackoverflow.com/questions/634745/how-to-programmatically-determine-iphone-interface-orientation

. While it might be useful to know that the device is flat this doesn't tell us whether it's flat displaying an interface oriented in portrait or landscape mode. Is there a way to find the current orientation of the GUI in cases where the device is returning ambiguous information I suppose I could track orientation change..

How do I get a background location update every n minutes in my iOS application?

http://stackoverflow.com/questions/6347503/how-do-i-get-a-background-location-update-every-n-minutes-in-my-ios-application

share improve this question Found a solution to implement this with the help of the Apple Developer Forums. I did the following Specify location background mode Use an NSTimer in the background by using UIApplication beginBackgroundTaskWithExpirationHandler In case n is smaller than UIApplication backgroundTimeRemaining..

Store orientation to an array - and compare

http://stackoverflow.com/questions/6368618/store-orientation-to-an-array-and-compare

NSLog @ pitch f roll f yaw f attitude.pitch attitude.roll attitude.yaw I'm thinking that I could store these values into an array if the user is in record mode. And when the user tries to replicate that movement I'm could compare the replicated movement array to the recorded one. The thing is how can I compare the two..

Learning OpenGL ES 1.x

http://stackoverflow.com/questions/72288/learning-opengl-es-1-x

Other than that just take what you know about OpenGL or learn that via other means and forget about all things that are old cruft display lists immediate mode things that are in OpenGL but are not directly related to just drawing triangles . Basically unlearn everything that has been declared deprecated in OpenGL 3.0...

Retrieving a pixel alpha value for a UIImage

http://stackoverflow.com/questions/1042830/retrieving-a-pixel-alpha-value-for-a-uiimage

not in fact need to translate between UIKit coordinates and Core Graphics coordinates. However after setting the blend mode my alpha values were what I expected CGContextSetBlendMode context kCGBlendModeCopy iphone uikit core graphics quartz graphics.. axis pointing up while in UIKit it points down. See the docs . Edit after reading code You also want to set the blend mode to replace before drawing the image since you want the image's alpha value not the one which was in the context's buffer..

How would I tint an image programatically on the iPhone?

http://stackoverflow.com/questions/1117211/how-would-i-tint-an-image-programatically-on-the-iphone

the iPhone I would like to tint an image with a color reference. The results should look like the Multiply blending mode in Photoshop where whites would be replaced with tint I will be changing the color value continuously. Follow up I would.. to draw the image first then overlay it with a rectangle filled with the color you want along with the proper blending mode something like this void drawRect CGRect area CGContextRef context UIGraphicsGetCurrentContext CGContextSaveGState context.. CGContextSaveGState context Draw picture first CGContextDrawImage context self.frame self.image.CGImage Blend mode could be any of CGBlendMode values. Now draw filled rectangle over top of image. CGContextSetBlendMode context kCGBlendModeMultiply..

Cropping a UIImage

http://stackoverflow.com/questions/158914/cropping-a-uiimage

image similar to what's seen in the album view of the Photos app. I know I could use a UIImageView and adjust the crop mode to achieve the same results but these images are sometimes displayed in UIWebViews . I've started to notice some crashes..

Is there a documented way to set the iPhone orientation?

http://stackoverflow.com/questions/181780/is-there-a-documented-way-to-set-the-iphone-orientation

where I would like to support device rotation in certain views but other don't particularly make sense in Landscape mode so as I swapping the views out I would like to force the rotation to be set to portrait. There is an undocumented property.. 2. I have already implemented shouldAutorotateToInterfaceOrientation for all views but if the user is in landscape mode in View 1 and then switches to View 2 I want to force the phone to rotate back to Portrait. iphone objective c cocoa touch..

Exit application in iOS 4.0

http://stackoverflow.com/questions/3097244/exit-application-in-ios-4-0

application was not accepted. now everything changed in iOS4.0 clicking the home button puts your app in a suspended mode multitasking .. and I think there should be a clear way for the user to exit the app like an exit button. is it now OK with..

NSDictionary with ordered keys

http://stackoverflow.com/questions/376090/nsdictionary-with-ordered-keys

How to customize the background/border colors of a grouped table view cell?

http://stackoverflow.com/questions/400965/how-to-customize-the-background-border-colors-of-a-grouped-table-view-cell

border and background itself in the appropriate colors. This view needs to be able to draw the borders in 4 different modes rounded on the top for the first cell in a section rounded on the bottom for the last cell in a section no rounded corners.. and rounded on all 4 corners for sections that contain one cell. Unfortunately I couldn't figure out how to have this mode set automatically so I had to set it in the UITableViewDataSource's cellForRowAtIndexPath method. It's a real PITA but I've..

iPhone app in landscape mode

http://stackoverflow.com/questions/402/iphone-app-in-landscape-mode

app in landscape mode What's the best way to create an iPhone application that runs in landscape mode from the start regardless of the position.. app in landscape mode What's the best way to create an iPhone application that runs in landscape mode from the start regardless of the position of the device Both programmatically and using the Interface Builder. iphone objective..

Lock-down iPhone/iPod/iPad so it can only run one app

http://stackoverflow.com/questions/5011774/lock-down-iphone-ipod-ipad-so-it-can-only-run-one-app

security ipad ipod jailbreak share improve this question It is possible to put an iPad or iPhone into 'Store Demo' mode so that the home button and swipe to home gesture is disabled. If you have seen the iPads in the Apple Store running the..

CADisplayLink OpenGL rendering breaks UIScrollView behaviour

http://stackoverflow.com/questions/5944050/cadisplaylink-opengl-rendering-breaks-uiscrollview-behaviour

scrolling which looks horrible . One temporary fix has been to use NSRunLoopCommonModes instead of the default run mode but unfortunately this breaks some aspects of scroll view behaviour on certain phones I'm testing on the 3GS and simulator.. this clash between the CADisplayLink and the UIScrollView or know how to fix the UIScrollView working in other run modes Thanks in advance Promised links to similar questions UIScrollView broken and halts scrolling with OpenGL rendering related..

UIImage: Resize, then Crop

http://stackoverflow.com/questions/603907/uiimage-resize-then-crop

each end to fit the rest to the width. I'm working in landscape so might not have noticed any deficiencies in portrait mode. Here's my code it's part of a categeory on UIImage. Target size in my code is always set to the full screen size of the..

How to programmatically determine iPhone interface orientation?

http://stackoverflow.com/questions/634745/how-to-programmatically-determine-iphone-interface-orientation

the device is flat this doesn't tell us whether it's flat displaying an interface oriented in portrait or landscape mode. Is there a way to find the current orientation of the GUI in cases where the device is returning ambiguous information..

How do I get a background location update every n minutes in my iOS application?

http://stackoverflow.com/questions/6347503/how-do-i-get-a-background-location-update-every-n-minutes-in-my-ios-application

to implement this with the help of the Apple Developer Forums. I did the following Specify location background mode Use an NSTimer in the background by using UIApplication beginBackgroundTaskWithExpirationHandler In case n is smaller than..

Store orientation to an array - and compare

http://stackoverflow.com/questions/6368618/store-orientation-to-an-array-and-compare

attitude.roll attitude.yaw I'm thinking that I could store these values into an array if the user is in record mode. And when the user tries to replicate that movement I'm could compare the replicated movement array to the recorded one...

Learning OpenGL ES 1.x

http://stackoverflow.com/questions/72288/learning-opengl-es-1-x

know about OpenGL or learn that via other means and forget about all things that are old cruft display lists immediate mode things that are in OpenGL but are not directly related to just drawing triangles . Basically unlearn everything that has..

Autorotate a single UIViewController in iOS 6 with UITabBar

http://stackoverflow.com/questions/12551247/autorotate-a-single-uiviewcontroller-in-ios-6-with-uitabbar

a single UIViewController in iOS 6 with UITabBar I have an app that work only in Portrait Mode but there is a singleView that can display video so i want that view work also in the landscape mode but in iOS 6 i can't..

Blur an image of specific part (rectangular, circular)?

http://stackoverflow.com/questions/14107979/blur-an-image-of-specific-part-rectangular-circular

and add the following four methods with the same sequence in your implementation file. Also set your ImageView Mode to 'Redraw'. Add UIImage Category for the blur effect as given or use any custom class it will work for you. Method 1 Cropping.. self.size NO self.scale self drawInRect CGRectMake 0 0 self.size.width self.size.height blendMode kCGBlendModeNormal alpha weight 0 for int x 1 x 5 x self drawInRect CGRectMake x 0 self.size.width self.size.height blendMode.. self.size NO self.scale self drawInRect CGRectMake 0 0 self.size.width self.size.height blendMode kCGBlendModeNormal alpha weight 0 for int x 1 x 5 x self drawInRect CGRectMake x 0 self.size.width self.size.height blendMode kCGBlendModeNormal..

Deploy from XCode 4.6.2 to iOS 7 (beta) device

http://stackoverflow.com/questions/17075894/deploy-from-xcode-4-6-2-to-ios-7-beta-device

I have found useful is building from Xcode 4.6.x to an iOS 7 device actually makes the phone run it in iOS6 or before Mode which is the way all apps run at the moment. So my guess is that this would be what your app would look like in iOS 7 if..

Advice on speeding up OpenGL ES 1.1 on the iPhone

http://stackoverflow.com/questions/1844765/advice-on-speeding-up-opengl-es-1-1-on-the-iphone

around 50 . I suppose this might have something to do with scaling the texture coordinates from GL_TEXTURE Matrix Mode. I'm still seeking additional improvements. I'd like to get closer to 40 FPS as that's what my iPod Touch gets and it's..

Drawing a PNG Image Into a Graphics Context for Blending Mode Manipulation

http://stackoverflow.com/questions/1936644/drawing-a-png-image-into-a-graphics-context-for-blending-mode-manipulation

a PNG Image Into a Graphics Context for Blending Mode Manipulation I need to draw a series of PNGs into a CG context so I can blend them together CGContextRef context UIGraphicsGetCurrentContext.. PNGs into a CG context so I can blend them together CGContextRef context UIGraphicsGetCurrentContext CGContextSetBlendMode context kCGBlendModeOverlay Currently I have my app working based on just drawing each image as a UIImageView and adding.. so I can blend them together CGContextRef context UIGraphicsGetCurrentContext CGContextSetBlendMode context kCGBlendModeOverlay Currently I have my app working based on just drawing each image as a UIImageView and adding them as a subview to..

Detect whether iPhone is displaying time in 12-Hour or 24-Hour Mode?

http://stackoverflow.com/questions/1972108/detect-whether-iphone-is-displaying-time-in-12-hour-or-24-hour-mode

whether iPhone is displaying time in 12 Hour or 24 Hour Mode How can you detect whether iPhone is displaying time in 12 Hour or 24 Hour Mode I currently monitor the current region.. displaying time in 12 Hour or 24 Hour Mode How can you detect whether iPhone is displaying time in 12 Hour or 24 Hour Mode I currently monitor the current region for changes however that's not the only setting that affects how times are displayed...

Landscape Mode ONLY for iPhone or iPad

http://stackoverflow.com/questions/2647786/landscape-mode-only-for-iphone-or-ipad

Mode ONLY for iPhone or iPad I want to create an application that doesn't use Portrait mode. I am not sure if I need to edit.. iphone objective c cocoa touch uikit ipad share improve this question Code found here Launching in Landscape Mode Applications in iPhone OS normally launch in portrait mode to match the orientation of the Home screen. If you have an application..

Want to use muliple nibs for different iphone interface orientations

http://stackoverflow.com/questions/3786727/want-to-use-muliple-nibs-for-different-iphone-interface-orientations

nibs for different iphone interface orientations I have a situation I have created two different nibs one in Portrait Mode and other in Landscape mode. I had lots of designs in the view so i had to opt for two different nibs. Now I want to toggle..

Height and width on iPhone (/iPad)

http://stackoverflow.com/questions/3972001/height-and-width-on-iphone-ipad

iphone objective c ipad interface uiwindow share improve this question I think the Launching in Landscape Mode of the iOS Application Programming Guide mostly explains what is happening with your test application Applications in iOS..

iPhone Landscape-Only Utility-Template Application

http://stackoverflow.com/questions/525737/iphone-landscape-only-utility-template-application

out your content in landscape mode and do the appropriate rotation using CFAffineTransform see Launching in Landscape Mode in iPhone OS Programming Guide. Going to find the reference for you I found this comment To launch a view controller “based..

Determining if Airplane Mode is enabled on an iPhone?

http://stackoverflow.com/questions/7696062/determining-if-airplane-mode-is-enabled-on-an-iphone

if Airplane Mode is enabled on an iPhone Is it possible to programatically determine if an iPhone is in Airplane Mode I specifically want.. if Airplane Mode is enabled on an iPhone Is it possible to programatically determine if an iPhone is in Airplane Mode I specifically want to know if it's in AirPlane Mode as opposed to having or not having a network connection. This question.. possible to programatically determine if an iPhone is in Airplane Mode I specifically want to know if it's in AirPlane Mode as opposed to having or not having a network connection. This question has been asked a lot but every answer I've seen has..

How to hide & unhide Master View Controller in SplitView Controller

http://stackoverflow.com/questions/8020323/how-to-hide-unhide-master-view-controller-in-splitview-controller

Navigation bar and i want by using which i can hide show my Master View both in Portrairt and Landscape Mode. IBAction hideUnhide id sender How can hide unhide How can i do this iphone ipad ios5 customization uisplitviewcontroller..