Search Results

Search found 4 results on 1 pages for 'kdbdallas'.

Page 1/1 | 1 

  • Malloc to a CGPoint Pointer throwing EXC_BAD_ACCESS when accessing

    - by kdbdallas
    I am trying to use a snippet of code from a Apple programming guide, and I am getting a EXC_BAD_ACCESS when trying to pass a pointer to a function, right after doing a malloc. (For Reference: iPhone Application Programming Guide: Event Handling - Listing 3-6) The code in question is really simple: CFMutableDictionaryRef touchBeginPoints; UITouch *touch; .... CGPoint *point = (CGPoint *)CFDictionaryGetValue(touchBeginPoints, touch); if (point == NULL) { point = (CGPoint *)malloc(sizeof(CGPoint)); CFDictionarySetValue(touchBeginPoints, touch, point); } Now when the program goes into the if statement it assigns the 'output' of malloc into the point variable/pointer. Then when it tries to pass point into the CFDictionarySetValue function it crashes the application with: Program received signal: “EXC_BAD_ACCESS”. Someone suggested not doing the malloc and pass the point var/pointer as: &point, however that still gave me a EXC_BAD_ACCESS. What I am (and it looks like Apple) doing wrong??? Thanks in advance.

    Read the article

  • Calculating Connection/Download Speed

    - by kdbdallas
    I have a client and server program (both in Obj-C) and I am transferring files between two devices using the programs. The transferring is working fine, but I would like to display to the user what transfer rate they are getting. So I know the total size of the file, and how much of the file has been transferred, is there a way to figure out the transfer rate from this information, and if not, what information do I need to calculate the transfer rate? Thanks

    Read the article

  • Select statement with multiple 'where' fields using same value without duplicating text

    - by kdbdallas
    I will start by saying that I don't think what I want can be done, but that said, I am hoping I am wrong and someone knows more than me. So here is your chance... Prove you are smarter than me :) I want to do a search against a SQLite table looking for any records that "are similar" without having to write out the query in long hand. To clarify this is how I know I can write the query: select * from Articles where title like '%Bla%' or category like '%Bla%' or post like '%Bla%' This works and is not a huge deal if you are only checking against a couple of columns, but if you need to check against a bunch then your query can get really long and nasty looking really fast, not to mention the chance for typos. (ie: 'Bla%' instead of '%Bla%') What I am wondering is if there is a short hand way to do this? *This next code does not work the way I want, but just shows kind of what I am looking for select * from Articles where title or category or post like '%Bla%' Anyone know if there is a way to specify that multiple 'where' columns should use the same search value without listing that same search value for every column? Thanks in advance!

    Read the article

  • Is there a way to suppress warnings in Xcode?

    - by kdbdallas
    Is there a way to suppress warnings in Xcode? For example I am calling an undocumented method and since the method is not in the header I get a warning on compile. I know I can add it to my header to stop the warning, but I am wondering if there is a way other then adding it to the header (so I can keep the headers clean and standard) to suppress the warning? A pragma or something?

    Read the article

1