Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-02-2012, 10:07 AM   #1 (permalink)
Registered Member
 
Join Date: Nov 2011
Posts: 5
wadheraswati is on a distinguished road
Default Core Graphics Line drawing and deleting on touch

I have to make an iPhone application somewhat like pick up sticks app on appstore. I have already done with drawing multiple lines and displaying it using CoreGraphics. But now I' stuck. What I need to do now is to delete the line when the user taps on it. I have googled a lot but dint find any method to do this. Please help. Its urgent..
Thanks..
wadheraswati is offline   Reply With Quote
Old 01-02-2012, 01:49 PM   #2 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,005
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by wadheraswati View Post
I have to make an iPhone application somewhat like pick up sticks app on appstore. I have already done with drawing multiple lines and displaying it using CoreGraphics. But now I' stuck. What I need to do now is to delete the line when the user taps on it. I have googled a lot but dint find any method to do this. Please help. Its urgent..
Thanks..
How are you drawing your lines? Do you have some sort of data structure that represents the pick-up-sticks, and draw the current set of sticks in drawRect?

If so, change your data structure to remove one of the lines, and then call setNeedsDisplay on your custom view so it gets redrawn.

You're going to have to provide a lot more information if you want help.

So you know, I tend to ignore vague, "How do I do <insert poorly described complex task>" type posts like this. They are generally very painful.

If you want help, think about the level of detail your readers will need in order to understand your problem enough to answer it. Provide as much RELEVANT detail as you can, while trimming away extraneous detail. If you post code, delete the Apple boilerplate code, for example. Post headers and method implementations for the specific question you are asking, and don't post entire .m files.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is online now   Reply With Quote
Old 01-07-2012, 12:34 PM   #3 (permalink)
Registered Member
 
Join Date: Nov 2011
Posts: 5
wadheraswati is on a distinguished road
Smile

Thanks for your reply. I am using UIBeizerpath to draw the lines one over the other or seperately. I want to remove a line on user touch only if there is no line above it or intersecting it. I have used the intersection method fr this which checks if a line touched by user is alone or intersected by some other line which in other words tell me taht there is a line above it or below it. But the problem is that i am not finding a tool to store these bezier paths in alist. I have tried using arrays, dictionaries, strings but nothing works. I f I'm able to do this then i'll just need to do 2 things.

1. check the line on which the user has tapped as there are many lines on the screen.
2. checking the intersection of that line by other lines in the list one after the other, if there is an intersection.
3. I'll just need to check that touched line is intersected by a line whose position is list is before or after the touched line. If it is after the touched line, then it means there is a line above the touched line, so it cannot be deleted. Otherwise if the line intersecting the touched line has position before it, then the touched line can be deleted because there is no line above it.

In simple words, please tell me a list type in which i can store the UIBezierpath objects and retrieve afterwards, ad method which can detect the line touched. My work will be done then.

Thanks..
wadheraswati is offline   Reply With Quote
Reply

Bookmarks

Tags
core graphics, ios, iphone, touch gestures

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 399
13 members and 386 guests
7twenty7, AppsBlogger, comicool, Creativ, Dalia, dansparrow, Duncan C, HemiMG, heshiming, LunarMoon, Murphy, pbart, Tomsky
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,127
Posts: 402,915
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:53 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0