[iPhone] Building a wrapper around Quartz 2D. trouble with contexts

I'm building myself a small ObjC wrapper around some of the basic Quartz 2D drawing functions such as
CGContextMoveToPoint(context, rect.origin.x, rect.size.height - 50);
and so on.
The problem I'm having is with contexts. My wrapper looks something like this:
- (void)moveToPoint:(CGPoint)point {
CGContextMoveToPoint(context, point.x, point.y);
"context" in this case is UIGraphicsGetCurrentContext(); which gets called in my wrapper's initializer. I have a feeling this is where the problem (my wrapper is not the same object where the drawRect: method is).
How do I get the proper context?

I've never actually done this, so there may very well be some hidden compositing gotcha preventing this from working as smoothly as one might hope, but generally speaking, the whole point of the subview is to delegate all drawing responsibility to it. If the parent wants to draw something around or behind one of its children then it should do so without concern for anyone else's behavior (though it will doubtlessly want to implement some form of hit testing in a case such as this to make sure everything lines up visually).

Similar Messages

  • IPhone - Build error: Command /usr/bin/codesign failed with exit code 1

    Hi
    can anyone help with error i'm getting when trying to get my iphone ready for distribution
    some post say to look at the keychain for more than one iphone distribution key but i'm only have one for distribution and one for development..
    anyone have any ideas??
    Regards

    question ?
    in the developer.apple.com and clicking on App id you can see the full ID plus .com.Name.AppName
    is this what should be in the info.plist (bundle Identifier)?
    have wiped my mac and started a fresh and just getting this error
    but can't find what the error means have done the guide step by step
    any further pointer would be helpful
    regards
    Tony

  • There is an app on my iphone 5 that floats around, it clear, square with circle in the middle how do I get rid of it

    There is a clear, square with circle in it app on screen that moves around, how Do I delete it?

    I think you may be talking about the zoom assist feature. It allows you to drag that "clear square" you were talking about over a certain part of your screen and then zoom in on it. It appears when you quickly double tap your screen with 3 fingers at the same time. It should disappear when you do the same thing - just double tap the screen using 3 fingers at the same time.

  • HT204266 I have an iPhone 4s and I have been having troubles with the downloaded apps. I have tried everything from re installation to restarting and deleting but nothing is working. When I press the icon, there is a flash and I return to my home screen.

    Exactly as I mentioned above, the app just gives a flasha nd returns to the home screen, I have tried everything and nothing has really worked. Any suggestions?

    Basic troubleshooting steps straight out of the User Guide are restart, reset, restore from backup, restore as NEW.  Have you been through ALL of these steps?

  • TS2755 iphone 4s - date and time is incorrect/trouble with imessages

    Had to go into settings and turn off automatic for date/time, it was a month behind and a few hours...whats up?

    Try a reset:
    Reset: Hold the Sleep/Wake and Home buttons and don’t let go until the screen goes dark and the Apple logo appears (no data will be lost)
    You can also try Reset Network Settings:
    Settings > Genera > Reset > Reset Network Settings
    (This will reset all settings. This will not delete any data.)
    Reset All Settings:
    Settings > Genera > Reset > Reset All Settings
    (This will reset all network settings. This will not delete any data.)

  • Iphone 5 trouble with charging, please help?

         Haven't had my iPhone for long (around November for my birthday) and for about the last couple of weeks recently I have had major trouble with the battery charge.
         At first I thought it was the cables, so I got new one after new one and they'd work but then stop working. Until the last one I just purchased, it pretty much stopped charging the phone straight away. No lightening or sound response, no connection via computer etc. So, when my charge ran out I still had it plugged into my computer and now my phone only chargers when it's off when it's plugged into a USB port (bear in mind, it doesn't connect to iTunes-it says USB is unrecognized although it still chargers the phone when off). However, it charges fairly quickly when off but when in use the charge diminishes just as quick as it takes to charge. Not only that but now whenever I wish to turn my iPhone off, it turns itself back on.
          I have recently sent off my phone to the Apple store to have it checked over and it came back to me saying they couldn't reproduce the symptons I had mentioned so there was me thinking everything was fine but nope, still faulty. So a bit disappointed with paying £7.00 for delivery to have nothing been done about it (not only that, but the phone as also out of charge when returned so it just seemed like my phone wasn't looked over one bit). Also a bit disappointed and annoyed at the fact I'm still paying for my monthly contract for the phone when I am unable to use it!!!
         I haven't damaged the phone (it basically looks brand new) and haven't exposed it to any liquids. The USB port on my phone where I charge it seems clear too.
          The annoyance of having to send it back to Apple costing me more money is offputting so does anyone have any other suggestions? I'm going to my local 3 store to see if they can help me out but I'm just a bit fed up now. Can see this is a popular problem amongst other iPhone users too.
    Many thanks!
    (Oh and need to add I HAVE updated everything on my phone, restored everything, restarted etc.)

    Yeah I went to the 3 store and they said that it costs if they find it's a software issue (which I believe isn't fair). However, after sending mine off and having it back exactly the same I headed off to the 3 store and asked to see what they could do for me. Of course, they can't touch Apple phones so they kindly phoned Apple again for me to only say that Apple have NO record of me even sending my phone off even though I have written and e-mail proof. They then said that they replaced my phone in which they didn't. So I spoke to the senior supervisor who said for me to send it off again (yawn) but to be replaced and if it doesn't then I have to e-mail her directly. It's such an annoying issue because I'm still paying for my phone when I can't even use it.
    My advice is, definitely go to the store. Even-though they can't actually replace it there and then or send it off themselves to be repaired but they (should) phone up Apple and help you further. Apple shouldn't be asking you for such an upfront cost without even looking at your phone as it could be another issue.
    That's me up to date. Sending it off tomorrow, hopefully receive a replaced working phone now.

  • I am having trouble with app updates on my iOS 5 iPhone never getting beyond the "waiting" state.

    I am having trouble with app updates on my iOS 5 iPhone never getting beyond the "waiting" state. I have tried signing out/in of my account, rebooting and removing/re-installing the apps.  This started shortly after going to iOS 5 but I am not certain if that is related.  All updates that I try now are stuck in "waiting".  I also tried removing the apps and then installing via iTunes desktop sync with no improvement.  The only thing that I have not tried so far is a restore to a prior iPhone backup.  I have not been able to find anything to indciate what the updates on waiting on.  There is plenty of space on the iPhone (16gb available).  Any suggestions on what to try next? 

    Hello there, Missy.
    First thing I would recommend is to check your downloads queue to make sure there is not an interrupted download per the following Knowledge Base article:
    iTunes: How to resume interrupted iTunes Store downloads
    http://support.apple.com/kb/HT1725
    If your download was interrupted using your iPhone, iPad, or iPod touch
    1. From the Home screen, tap the iTunes app.
    2. For iPhone or iPod touch, tap More > Downloads. For iPad, tap Downloads.
    3. Enter your account name and password if prompted.
    4. Tap the blue download arrow to resume.
    If you can't complete the download on your iOS device, you can download it in iTunes on your Mac or PC and then sync it to your iOS device. You can also transfer purchases from your iPhone, iPad, or iPod to a computer.
    For Apps, you can also try tapping on the application icon to resume the download, as outline in this featured discussion:
    App updates won't download on my...: Apple Support Communities
    https://discussions.apple.com/thread/4111336
    Try tapping the App, so that it changes to Paused instead of Waiting, then tap it again to resume the install.
    Make sure you don't have any paused downloads in other apps either, like the App Store or iTunes Store.
    If that doesn't do it, try resetting or restoring the iPhone.
    via whatheck
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • I have been having trouble with my iphone 4 for the past day . i tried to update it to 7.0.4 then the screen went blank and it keeps telling me to connect to itunes . I have connected it to 2 computers , using different cords

    I have been having trouble with my iphone 4 for the past day . i tried to update it to 7.0.4 then the screen went blank and it keeps telling me to connect to itunes . I have connected it to 2 computers , using different cords and it doesnt recognize it . It says it is in recovery mode and i need to restore . after clicking restore it says that my iphone cannot be restored . I am very frustrated because i have been online searching for solutions all day and nothing seems to work . As soon as i turn on my phone it goes to the apple logo for about 2 seconds then the connect to itunes screen . SOMEBODY PLEASE HELP ! my phone is my life and i need it back on .

    Connect the device to iTunes and restore from the most current backup.
    If the issue continues, restore as new.

  • IMessage trouble with two iPhones and one Apple ID

    Hi,
    I'm having trouble with iMessage after updating both of my iPhones to iOS 6 and not being able to use iMessage with one of the phones.
    Some background:
    -I have two iPhones, one on AT&T in the U.S., and one on NTT DoCoMo in Japan, both with separate phone numbers, using the same Apple ID.
    -The AT&T iPhone is a 4, the NTT is an unlocked 4S.
    On my 4 (AT&T), on iMessage, I have the option to send/receive as my U.S. phone number and my Apple ID. Works just like before updating.
    On my 4S (NTT), on iMessage, before I updated, I was able to send/receive using my Japanese number and Apple ID. After updating, I have the option to send/receive using my U.S. number and Apple ID. My Japanese number is greyed out and I cannot select it. When I turn on iMessage, it says "Waiting for activation..." and does not do anything. Turning iMessage off and on, some times I get an error message staying that activation cannot be completed.
    I have rebooted the phone multiple times, turned on/off iMessage and FaceTime, turned the Set Date & Time Automatically option on/off, and reset Network settings several times. Nothing works; iMessage will not activate on my NTT 4S. Please help!

    Finally resolved this issue after months of off and on troubleshooting.
    I have no idea exactly which steps "fixed" the issue, but here's what I did. None of the basic troubleshooting steps that are on here worked for me, and this is including restoring both phones in iTunes as a "last resort" step that two Apple technical service representatives suggested.
    I found a post on here from user "tungddao" who suggested:
    "Turn on iMessage then make a phone call to : 011+445773142076
                 With Facetime & Siri: 011+447786205094"
    I called both numbers with my NTT 4S, and both numbers hung up right away. I also texted both numbers, and the FaceTime one went through, while the iMessage number did not. I then checked my SMS blocking settings with NTT. There were no blocks, but I reset the settings to "unblock all" anyway.
    I was able to activate iMessage and FaceTime with my Apple ID and my NTT phone number. Halfway there.
    I then turned on my ATT 4, and while I could send/receive using my Apple ID and NTT phone number, the ATT number was greyed out, which was the opposite of what had happened before, when I could use the ATT number, but not the NTT one. On my NTT 4S, I could select my ATT number, but it was stuck on "verifying" for days, and I knew it wouldn't go through.
    So, I signed out of my Apple ID on iMessage and FaceTime on my ATT 4, and turned both services off. I turned on data roaming, and turned off WiFi. *This step was key to activating both services, as they would not activate over WiFi for some reason.
    I turned on iMessage and FaceTime without signing in to my Apple ID just yet. They both activated successfully, and then I signed into my Apple ID on both services, and from then on, I can use both numbers and my Apple ID on both phones! Finally!
    These are my current options:
    Phone 1 (4S on NTT): Phone 1's #, Phone 2's #, Apple ID
    Phone 2 (4 on ATT, roaming here in Japan on Softbank): Phone 2's #, Phone 1's #, Apple ID
    Hope this helps someone out there, as this issue was real frustrating for me.

  • Just bought a new iPhone and am having trouble with iTunes and App Store. I can log in to Cloud, iTunes, and app store but once I try to download, it says "Youe apple id has been disabled". I've reset my password three times and have no issue on my Pad.

    Just bought a new iPhone and am having trouble with iTunes and App Store. I can log in to Cloud, iTunes, and app store but once I try to download, it says "Youe apple id has been disabled". I've reset my password three times and have no issue on my Pad.

    Hi FuzzyDunlopIsMe,
    Welcome to the Support Communities!
    It's possible that resetting your password multiple times has triggered this security.  Click on the link below for assistance with your Apple ID Account:
    Apple ID: Contacting Apple for help with Apple ID account security
    http://support.apple.com/kb/HT5699
    Here is some additional information regarding your Apple ID:
    Apple ID: 'This Apple ID has been disabled for security reasons' alert appears
    http://support.apple.com/kb/ts2446
    Frequently asked questions about Apple ID
    http://support.apple.com/kb/HT5622
    Click on My Apple ID to access and edit your account.
    Cheers,
    - Judy

  • My husband and i use the same apple id on our iphones and ipods, now we are having trouble how do we separate them?

    My husband and I use the same apple id and itunes accounts for each of our phones.  His is an Iphone 4 and mine is an 4s.  After this last update we are having trouble with his texting.  
    How do we go about separating our account into two accounts with the same apps and itunes. 

    You would need to create a new Apple ID and re-download and/or repurchase any apps.
    However, if it's just a matter of texting, you can go to Settings -> Messages -> Send & Recieve and check which addresses each phone should receive iMessages addressed to.

  • I'm having trouble with my Apple ID. I changed my email account, and recently (a month ago) and since I switched is requested every time I open any app to Apple ID password to the old email. How can I solve this? Could it be that my iPhone 4S is in sync w

    I'm having trouble with my Apple ID. I changed my email account, and recently (a month ago) and since I switched is requested every time I open any app to Apple ID password to the old email. How can I solve this? Could it be that my iPhone 4S is in sync with my Ipod???

    If you updated your existing account then try logging out of it on the iPhone by tapping on the id in Settings > iTunes & App Stores and then log back in and see if that 'refreshes' the account on the iPhone. If you created a new account then any content that you purchased/downloaded via the old account will remain tied to that old account, and only that old account can download updates to its apps.

  • I need any help i can get, im having trouble with the app find my iphone. I have lost my iphone, checked on the computer, and somehow, took it away so how do i get it back??

    Help
    I need any help i can get, im having trouble with the app find my iphone. I have lost my iphone, checked on the computer, and somehow, took it away so how do i get it back??

    If you are saying that after signing into iCloud it is telling you device is not found, it could be for any number of reasons. If the battery is dead, if the SIM has been removed, or if someone else has the phone and they have restored it, it will not be shown. Also, if you located it once and then sent a remote wipe, it disables the abililty to locate the phone with Find My iPhone.

  • Several of us have a iPhone 6s and are having trouble with hearing and speaking at the same time when using the phone. ? The speakers seem to be too far apart? Are others having this issue? Solutions?

    Several of us have a iPhone 6plus and are having trouble with hearing and speaking at the same time when using the phone. ? The speakers seem to be too far apart? Are others having this issue? Solutions?

    Not having the problem, don't personally know anyone who is.

  • I'm having trouble with installing a 8g kit in my late 2009 mac mini. when the parts are installed all i get is a beeping sound, is there any way to get around this?

    i'm having trouble with installing a 8g kit in my late 2009 mac mini. when the parts are installed all i get is a beeping sound, is there any way to get around this?

    What is the source & link to this 8 GB kit please?
    Can you count the beeps or flashes?
    1 beep = no RAM installed
    2 beeps = incompatible RAM types
    3 beeps = no good banks
    4 beeps = no good boot images in the boot ROM (and/or bad sys config block)
    5 beeps = processor is not usable
    In addition to the beeps, on some computers the power LED will flash a corresponding number of times plus one. The LED will repeat the sequence after approximately a 5-second pause. The tones are only played once.
    Note: In this case, a flash is considered to be 1/4 second or 250 ms or greater in length.
    http://support.apple.com/kb/HT1547

Maybe you are looking for

  • Stuck with a partially downloaded song

    On my 3rd generation iPad, I am stuck with a song I partially downloaded. In iTunes>Purchases, I clicked on the cloud next to the song title. It started to download on my iPad. Somehow, I thought the better of it, I didn't need the song on my iPad, s

  • CNTL_ERROR at RFC

    Hi all, The issue: I have got an interesting short dump: " A RAISE statement in the program CL_GUI_CUSTOM_CONTAINER=======CP" raised the exception condition "CNTL_ERROR". " The background: I have two systems, "CRM"  and "B". In "B" I have a function

  • Please help me out with some fundamentals in BW

    Hello, Please guide me regarding the below mentioned questions. 1. what is the key date in query designer. 2. when do we perform attribute change run     like once the master data is loaded then we perform attribute change run and load the transactio

  • Please read urgent

    #URGENT I opened my friends find my iphone app and saw noticed that my iphone was paired and he can see where i am, how do i remove my device from his find my iphone app without openning his phone

  • Disappointment with iBooks 1.1 PDF support

    Unless I'm missing something- The only way to get a PDF into iBooks 1.1 for it to be an attachment in Mail. You have to download the attachment, QuickLook it, then click the "Open in-" button near the top. If you have a collection of PDFs you want on