¡@

Home 

2014/10/15 ¤U¤È 10:04:35

iphone Programming Glossary: bit

How to check for an active Internet Connection on iPhone SDK?

http://stackoverflow.com/questions/1083701/how-to-check-for-an-active-internet-connection-on-iphone-sdk

Cocoa Touch libraries. I came up with a way to do this using an NSURL . The way I did it seems a bit unreliable because even Google could one day be down and relying on a 3rd party seems bad and while..

Reading ePub format

http://stackoverflow.com/questions/1388467/reading-epub-format

packaged up OEBPS a zip file of everything in the manifest plus a few extra files The specs look a bit daunting but actually once you've got the basics unzipping parsing XML down it's not particularly difficult..

AES Encryption for an NSString on the iPhone

http://stackoverflow.com/questions/1400246/aes-encryption-for-an-nsstring-on-the-iphone

errors. A later comment on that post includes this adapted code which works for me and seems a bit more straightforward. If you include their code for the NSData category you can write something like..

Cropping a UIImage

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

are sometimes displayed in UIWebViews . I've started to notice some crashes in this code and I'm a bit stumped. I've got two different theories and I'm wondering if either is on base. Theory 1 I achieve..

How to access SOAP services from iPhone

http://stackoverflow.com/questions/204465/how-to-access-soap-services-from-iphone

basic checking in the iPhone SDK I was not able to find any support for accessing SOAP services a bit of Googling lead to the conclusion that there is no support for SOAP in the iPhone SDK. So if I do want..

Programmatically add custom event in the iPhone Calendar

http://stackoverflow.com/questions/246249/programmatically-add-custom-event-in-the-iphone-calendar

icalendar ical share improve this question Based on Apple Documentation this has changed a bit as of iOS 6.0. 1 You should request access to the user's calendar via requestAccessToEntityType completion..

Bold & Non-Bold Text In A Single UILabel?

http://stackoverflow.com/questions/3586871/bold-non-bold-text-in-a-single-uilabel

as plain text without attributes. The second is to use CoreText and get similar results with a bit more of code. Interested people please look down the old answer. Now I am just being lazy so p _label..

Can I embed a custom font in an iPhone application?

http://stackoverflow.com/questions/360751/can-i-embed-a-custom-font-in-an-iphone-application

showthread.php t 569311 but these would require me to render each glyph myself which is a bit too much like hard work especially for multi line text. I've also found posts that say straight out..

display image from URL retrieved from ALAsset in iPhone

http://stackoverflow.com/questions/3837115/display-image-from-url-retrieved-from-alasset-in-iphone

while trying to get this working anyway. iOS 5 update When the result block fires seems to be a bit slower with iOS5 maybe single core devices so I couldnt rely on the image to be available directly after..

What's the best way to communicate between view controllers?

http://stackoverflow.com/questions/569940/whats-the-best-way-to-communicate-between-view-controllers

app delegate and reference the viewcontroller instances in the app delegate methods. Fair 'nuff. A bit further on we get this slide telling us what we should do. Page 18 51 Best Practices for Data Flow Figure.. I wish the videos were available Ok so... I'm afraid my objc fu is not so strong. I'm also a bit confused by the final line in the above quote. I've been doing my fair share of googling about this..

What's the easiest way to resize/optimize an image size with the iPhone SDK?

http://stackoverflow.com/questions/612131/whats-the-easiest-way-to-resize-optimize-an-image-size-with-the-iphone-sdk

display to show the image in its original size I'm planning on resizing the image to something a bit smaller to save on space performance. Also some of those images are JPEGs and they are not saved as..

Locking the Fields in MFMailComposeViewController

http://stackoverflow.com/questions/6284599/locking-the-fields-in-mfmailcomposeviewcontroller

@ text plain kSKPSMTPPartContentTypeKey bodyMessage kSKPSMTPPartMessageKey @ 8bit kSKPSMTPPartContentTransferEncodingKey nil testMsg.parts NSArray arrayWithObjects plainPart nil testMsg.. removeFromSuperview spinner release The final results are shown below. The screen appears to dim a bit kind of like when an UIAlert is shown . It shows a message saying its being sent and then brightens..

Understanding reference counting with Cocoa and Objective-C

http://stackoverflow.com/questions/6578/understanding-reference-counting-with-cocoa-and-objective-c

explicitly and then explicitly release it when you're done. Consider the following very contrived bit of code and you'll see a situation where autorelease is required NSString createHelloWorldString NSString.. still be valid for the caller of this function. return s autorelease I realize all of this is a bit confusing at some point though it will click. Here are a few references to get you going Apple's introduction..

What is the best way to deal with the NSDateFormatter locale “feature”?

http://stackoverflow.com/questions/6613110/what-is-the-best-way-to-deal-with-the-nsdateformatter-locale-feature

the NSDateFormatter locale &ldquo feature&rdquo It seems that NSDateFormatter has a feature that bites you unexpectedly If you do a simple fixed format operation such as NSDateFormatter fmt NSDateFormatter.. to set the locale of the date formatter for a specific region generally the US but this is a bit messy NSLocale loc NSLocale alloc initWithLocaleIdentifier @ en_US df setLocale loc loc release Not..

How can I programmatically get the MAC address of an iphone

http://stackoverflow.com/questions/677530/how-can-i-programmatically-get-the-mac-address-of-an-iphone

this question Somthing I stumbled across a while ago. Originally from here I modified it a bit and cleaned things up. IPAddress.h IPAddress.c And to use it InitAddresses GetIPAddresses GetHWAddresses..

UIDevice uniqueIdentifier Deprecated - What To Do Now?

http://stackoverflow.com/questions/6993325/uidevice-uniqueidentifier-deprecated-what-to-do-now

i. e. it should stay the same when the user uninstalls and re installs the app. This requires a bit of effort since the most reliable per device identifier seems to be the MAC address. You could query..

performSelector may cause a leak because its selector is unknown

http://stackoverflow.com/questions/7017281/performselector-may-cause-a-leak-because-its-selector-is-unknown

Example When the selector takes arguments or returns a value you'll have to change things a bit SEL selector NSSelectorFromString @ processRegion ofView IMP imp _controller methodForSelector selector..

iPhone: How to load a View using a nib file created with Interface Builder

http://stackoverflow.com/questions/863321/iphone-how-to-load-a-view-using-a-nib-file-created-with-interface-builder

How to load a View using a nib file created with Interface Builder I'm trying to do something a bit elaborate but that should be possible so here is a challenge for all you experts out there this forum..

How to check for an active Internet Connection on iPhone SDK?

http://stackoverflow.com/questions/1083701/how-to-check-for-an-active-internet-connection-on-iphone-sdk

see if I have an Internet connection on the iPhone using the Cocoa Touch libraries. I came up with a way to do this using an NSURL . The way I did it seems a bit unreliable because even Google could one day be down and relying on a 3rd party seems bad and while I could check to see for a response from some other websites..

Reading ePub format

http://stackoverflow.com/questions/1388467/reading-epub-format

OPF which is an XML file one to define how everything is packaged up OEBPS a zip file of everything in the manifest plus a few extra files The specs look a bit daunting but actually once you've got the basics unzipping parsing XML down it's not particularly difficult or complex. You'll need to work out how to download..

AES Encryption for an NSString on the iPhone

http://stackoverflow.com/questions/1400246/aes-encryption-for-an-nsstring-on-the-iphone

the extra comma in each call to CCCrypt which caused compile errors. A later comment on that post includes this adapted code which works for me and seems a bit more straightforward. If you include their code for the NSData category you can write something like this Note The printf calls are only for demonstrating the state..

Cropping a UIImage

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

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 got two different theories and I'm wondering if either is on base. Theory 1 I achieve the cropping by drawing into an offscreen image context of my..

How to access SOAP services from iPhone

http://stackoverflow.com/questions/204465/how-to-access-soap-services-from-iphone

have to access a couple of SOAP services. While doing some basic checking in the iPhone SDK I was not able to find any support for accessing SOAP services a bit of Googling lead to the conclusion that there is no support for SOAP in the iPhone SDK. So if I do want to build that app I'll need to come up with a approach to..

Programmatically add custom event in the iPhone Calendar

http://stackoverflow.com/questions/246249/programmatically-add-custom-event-in-the-iphone-calendar

the iPhone Calendar from the custom App iphone events calendar icalendar ical share improve this question Based on Apple Documentation this has changed a bit as of iOS 6.0. 1 You should request access to the user's calendar via requestAccessToEntityType completion and execute the event handling inside of a block. 2 You..

Bold & Non-Bold Text In A Single UILabel?

http://stackoverflow.com/questions/3586871/bold-non-bold-text-in-a-single-uilabel

The first one is to do something less fancy and show it just as plain text without attributes. The second is to use CoreText and get similar results with a bit more of code. Interested people please look down the old answer. Now I am just being lazy so p _label setText text There is a couple of good introductory blog posts..

Can I embed a custom font in an iPhone application?

http://stackoverflow.com/questions/360751/can-i-embed-a-custom-font-in-an-iphone-application

thread.jspa messageID 8304744 http forums.macrumors.com showthread.php t 569311 but these would require me to render each glyph myself which is a bit too much like hard work especially for multi line text. I've also found posts that say straight out that it's not possible but without justification so I'm looking..

display image from URL retrieved from ALAsset in iPhone

http://stackoverflow.com/questions/3837115/display-image-from-url-retrieved-from-alasset-in-iphone

node.view.largeImage if thumb blah blah Thats what I learned while trying to get this working anyway. iOS 5 update When the result block fires seems to be a bit slower with iOS5 maybe single core devices so I couldnt rely on the image to be available directly after calling findLargeImage . So I changed it to call out to..

What's the best way to communicate between view controllers?

http://stackoverflow.com/questions/569940/whats-the-best-way-to-communicate-between-view-controllers

used for communicating between the viewcontroller into your app delegate and reference the viewcontroller instances in the app delegate methods. Fair 'nuff. A bit further on we get this slide telling us what we should do. Page 18 51 Best Practices for Data Flow Figure out exactly what needs to be communicated Define input.. best practices using an example with the UIImagePickerController. I wish the videos were available Ok so... I'm afraid my objc fu is not so strong. I'm also a bit confused by the final line in the above quote. I've been doing my fair share of googling about this and I found what appears to be a decent article talking about..

What's the easiest way to resize/optimize an image size with the iPhone SDK?

http://stackoverflow.com/questions/612131/whats-the-easiest-way-to-resize-optimize-an-image-size-with-the-iphone-sdk

instance . Since the iPhone doesn't even have a big enough display to show the image in its original size I'm planning on resizing the image to something a bit smaller to save on space performance. Also some of those images are JPEGs and they are not saved as the usual 60 quality setting. How can I resize a picture with..

Locking the Fields in MFMailComposeViewController

http://stackoverflow.com/questions/6284599/locking-the-fields-in-mfmailcomposeviewcontroller

you want. NSDictionary plainPart NSDictionary dictionaryWithObjectsAndKeys @ text plain kSKPSMTPPartContentTypeKey bodyMessage kSKPSMTPPartMessageKey @ 8bit kSKPSMTPPartContentTransferEncodingKey nil testMsg.parts NSArray arrayWithObjects plainPart nil testMsg send void messageSent SKPSMTPMessage message message release.. void stopSpinner spinner stopAnimating spinner removeFromSuperview spinner release The final results are shown below. The screen appears to dim a bit kind of like when an UIAlert is shown . It shows a message saying its being sent and then brightens back up when the message is sent. Happy Coding share improve..

Understanding reference counting with Cocoa and Objective-C

http://stackoverflow.com/questions/6578/understanding-reference-counting-with-cocoa-and-objective-c

you want to hang onto that string you'd need to call retain explicitly and then explicitly release it when you're done. Consider the following very contrived bit of code and you'll see a situation where autorelease is required NSString createHelloWorldString NSString s NSString alloc initWithString @ Hello World Now what.. later time. The consequence is that the returned string will still be valid for the caller of this function. return s autorelease I realize all of this is a bit confusing at some point though it will click. Here are a few references to get you going Apple's introduction to memory management. Cocoa Programming for Mac OS..

What is the best way to deal with the NSDateFormatter locale “feature”?

http://stackoverflow.com/questions/6613110/what-is-the-best-way-to-deal-with-the-nsdateformatter-locale-feature

is the best way to deal with the NSDateFormatter locale &ldquo feature&rdquo It seems that NSDateFormatter has a feature that bites you unexpectedly If you do a simple fixed format operation such as NSDateFormatter fmt NSDateFormatter alloc init fmt setDateFormat @ yyyyMMddHHmmss NSString.. and they aren't going to fix it. The circumvention is apparently to set the locale of the date formatter for a specific region generally the US but this is a bit messy NSLocale loc NSLocale alloc initWithLocaleIdentifier @ en_US df setLocale loc loc release Not too bad in onsies twosies but I'm dealing with about ten different..

How can I programmatically get the MAC address of an iphone

http://stackoverflow.com/questions/677530/how-can-i-programmatically-get-the-mac-address-of-an-iphone

and IP address iphone objective c mac address share improve this question Somthing I stumbled across a while ago. Originally from here I modified it a bit and cleaned things up. IPAddress.h IPAddress.c And to use it InitAddresses GetIPAddresses GetHWAddresses int i NSString deviceIP nil for i 0 i MAXADDRS i static..

UIDevice uniqueIdentifier Deprecated - What To Do Now?

http://stackoverflow.com/questions/6993325/uidevice-uniqueidentifier-deprecated-what-to-do-now

a new one each time. But you might want it to be not unique i. e. it should stay the same when the user uninstalls and re installs the app. This requires a bit of effort since the most reliable per device identifier seems to be the MAC address. You could query the MAC and use that as UUID. Edit One needs to always query..

performSelector may cause a leak because its selector is unknown

http://stackoverflow.com/questions/7017281/performselector-may-cause-a-leak-because-its-selector-is-unknown

types don't match . Finally you call the function pointer. Complex Example When the selector takes arguments or returns a value you'll have to change things a bit SEL selector NSSelectorFromString @ processRegion ofView IMP imp _controller methodForSelector selector CGRect func id SEL CGRect UIView void imp CGRect result..

iPhone: How to load a View using a nib file created with Interface Builder

http://stackoverflow.com/questions/863321/iphone-how-to-load-a-view-using-a-nib-file-created-with-interface-builder

How to load a View using a nib file created with Interface Builder I'm trying to do something a bit elaborate but that should be possible so here is a challenge for all you experts out there this forum is pack of the lot of you . Im creating a Questionnaire component..

How to check for an active Internet Connection on iPhone SDK?

http://stackoverflow.com/questions/1083701/how-to-check-for-an-active-internet-connection-on-iphone-sdk

the iPhone using the Cocoa Touch libraries. I came up with a way to do this using an NSURL . The way I did it seems a bit unreliable because even Google could one day be down and relying on a 3rd party seems bad and while I could check to see..

Reading ePub format

http://stackoverflow.com/questions/1388467/reading-epub-format

how everything is packaged up OEBPS a zip file of everything in the manifest plus a few extra files The specs look a bit daunting but actually once you've got the basics unzipping parsing XML down it's not particularly difficult or complex...

AES Encryption for an NSString on the iPhone

http://stackoverflow.com/questions/1400246/aes-encryption-for-an-nsstring-on-the-iphone

which caused compile errors. A later comment on that post includes this adapted code which works for me and seems a bit more straightforward. If you include their code for the NSData category you can write something like this Note The printf..

Cropping a UIImage

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

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 got two different theories and I'm wondering if either is on base. Theory 1 I achieve the cropping by drawing..

How to access SOAP services from iPhone

http://stackoverflow.com/questions/204465/how-to-access-soap-services-from-iphone

While doing some basic checking in the iPhone SDK I was not able to find any support for accessing SOAP services a bit of Googling lead to the conclusion that there is no support for SOAP in the iPhone SDK. So if I do want to build that app..

Programmatically add custom event in the iPhone Calendar

http://stackoverflow.com/questions/246249/programmatically-add-custom-event-in-the-iphone-calendar

iphone events calendar icalendar ical share improve this question Based on Apple Documentation this has changed a bit as of iOS 6.0. 1 You should request access to the user's calendar via requestAccessToEntityType completion and execute the..

Bold & Non-Bold Text In A Single UILabel?

http://stackoverflow.com/questions/3586871/bold-non-bold-text-in-a-single-uilabel

fancy and show it just as plain text without attributes. The second is to use CoreText and get similar results with a bit more of code. Interested people please look down the old answer. Now I am just being lazy so p _label setText text There..

Can I embed a custom font in an iPhone application?

http://stackoverflow.com/questions/360751/can-i-embed-a-custom-font-in-an-iphone-application

http forums.macrumors.com showthread.php t 569311 but these would require me to render each glyph myself which is a bit too much like hard work especially for multi line text. I've also found posts that say straight out that it's not possible..

display image from URL retrieved from ALAsset in iPhone

http://stackoverflow.com/questions/3837115/display-image-from-url-retrieved-from-alasset-in-iphone

Thats what I learned while trying to get this working anyway. iOS 5 update When the result block fires seems to be a bit slower with iOS5 maybe single core devices so I couldnt rely on the image to be available directly after calling findLargeImage..

What's the best way to communicate between view controllers?

http://stackoverflow.com/questions/569940/whats-the-best-way-to-communicate-between-view-controllers

into your app delegate and reference the viewcontroller instances in the app delegate methods. Fair 'nuff. A bit further on we get this slide telling us what we should do. Page 18 51 Best Practices for Data Flow Figure out exactly what.. UIImagePickerController. I wish the videos were available Ok so... I'm afraid my objc fu is not so strong. I'm also a bit confused by the final line in the above quote. I've been doing my fair share of googling about this and I found what appears..

What's the easiest way to resize/optimize an image size with the iPhone SDK?

http://stackoverflow.com/questions/612131/whats-the-easiest-way-to-resize-optimize-an-image-size-with-the-iphone-sdk

have a big enough display to show the image in its original size I'm planning on resizing the image to something a bit smaller to save on space performance. Also some of those images are JPEGs and they are not saved as the usual 60 quality..

Locking the Fields in MFMailComposeViewController

http://stackoverflow.com/questions/6284599/locking-the-fields-in-mfmailcomposeviewcontroller

dictionaryWithObjectsAndKeys @ text plain kSKPSMTPPartContentTypeKey bodyMessage kSKPSMTPPartMessageKey @ 8bit kSKPSMTPPartContentTransferEncodingKey nil testMsg.parts NSArray arrayWithObjects plainPart nil testMsg send void messageSent.. spinner removeFromSuperview spinner release The final results are shown below. The screen appears to dim a bit kind of like when an UIAlert is shown . It shows a message saying its being sent and then brightens back up when the message..

Understanding reference counting with Cocoa and Objective-C

http://stackoverflow.com/questions/6578/understanding-reference-counting-with-cocoa-and-objective-c

need to call retain explicitly and then explicitly release it when you're done. Consider the following very contrived bit of code and you'll see a situation where autorelease is required NSString createHelloWorldString NSString s NSString alloc.. returned string will still be valid for the caller of this function. return s autorelease I realize all of this is a bit confusing at some point though it will click. Here are a few references to get you going Apple's introduction to memory..

What is the best way to deal with the NSDateFormatter locale “feature”?

http://stackoverflow.com/questions/6613110/what-is-the-best-way-to-deal-with-the-nsdateformatter-locale-feature

way to deal with the NSDateFormatter locale &ldquo feature&rdquo It seems that NSDateFormatter has a feature that bites you unexpectedly If you do a simple fixed format operation such as NSDateFormatter fmt NSDateFormatter alloc init fmt.. is apparently to set the locale of the date formatter for a specific region generally the US but this is a bit messy NSLocale loc NSLocale alloc initWithLocaleIdentifier @ en_US df setLocale loc loc release Not too bad in onsies twosies..

How can I programmatically get the MAC address of an iphone

http://stackoverflow.com/questions/677530/how-can-i-programmatically-get-the-mac-address-of-an-iphone

address share improve this question Somthing I stumbled across a while ago. Originally from here I modified it a bit and cleaned things up. IPAddress.h IPAddress.c And to use it InitAddresses GetIPAddresses GetHWAddresses int i NSString..

UIDevice uniqueIdentifier Deprecated - What To Do Now?

http://stackoverflow.com/questions/6993325/uidevice-uniqueidentifier-deprecated-what-to-do-now

it to be not unique i. e. it should stay the same when the user uninstalls and re installs the app. This requires a bit of effort since the most reliable per device identifier seems to be the MAC address. You could query the MAC and use that..

performSelector may cause a leak because its selector is unknown

http://stackoverflow.com/questions/7017281/performselector-may-cause-a-leak-because-its-selector-is-unknown

function pointer. Complex Example When the selector takes arguments or returns a value you'll have to change things a bit SEL selector NSSelectorFromString @ processRegion ofView IMP imp _controller methodForSelector selector CGRect func id SEL..

iPhone: How to load a View using a nib file created with Interface Builder

http://stackoverflow.com/questions/863321/iphone-how-to-load-a-view-using-a-nib-file-created-with-interface-builder

How to load a View using a nib file created with Interface Builder I'm trying to do something a bit elaborate but that should be possible so here is a challenge for all you experts out there this forum is pack of the lot..

where to start with audio synthesis on iPhone

http://stackoverflow.com/questions/2067267/where-to-start-with-audio-synthesis-on-iphone

outBuffer mAudioDataByteSize kBufferSizeInFrames m_outFormat.mBytesPerFrame Generate the sine waves to Signed 16 Bit Stero interleaved Little Endian float volumeL m_waves kLeftWave .volume float volumeR m_waves kRightWave .volume float phaseL.. 1 m_outFormat.mChannelsPerFrame 2 m_outFormat.mBytesPerPacket m_outFormat.mBytesPerFrame sizeof UInt16 2 m_outFormat.mBitsPerChannel 16 m_outFormat.mReserved 0 OSStatus result AudioQueueNewOutput m_outFormat BleepMachine staticQueueCallback..

Help for AES-128 Bit Algorithm ?? i want to encrypt it

http://stackoverflow.com/questions/2774239/help-for-aes-128-bit-algorithm-i-want-to-encrypt-it

for AES 128 Bit Algorithm i want to encrypt it Can i get link for AES 128 Bit Algorithm any sample code please help objective c iphone.. for AES 128 Bit Algorithm i want to encrypt it Can i get link for AES 128 Bit Algorithm any sample code please help objective c iphone encryption aes share improve this question AES 128 is already..

Linker error (only simulator) with own library after update to iPhone SDK 4.0

http://stackoverflow.com/questions/3140469/linker-error-only-simulator-with-own-library-after-update-to-iphone-sdk-4-0

be okay as it worked with simulator 3.2 before I updated XCode and my SDK. More Facts Mac OS X 10.6.3 XCode 3.2.3 64 Bit iPhone OS 3.2 GCC 4.2 Any help would be highly appreciated. EDIT After reinstalling SDK 3.2 everything worked as expected..

Multiple value enum in Obj-C

http://stackoverflow.com/questions/4176149/multiple-value-enum-in-obj-c

CGFloat-based math functions?

http://stackoverflow.com/questions/5352457/cgfloat-based-math-functions

the compiler convert between double and float all the time. And not caring about possible Implicit conversion to 32 Bit Type warnings. Or maybe the best strategy bet on no 64 bit version of iOS will ever arrive or at least in a near enough..