objective-c

Cocoa - does CGDataProviderCopyData() actually copy the bytes? Or just the pointer?

I'm running that method in quick succession as fast as I can, and the faster the better, so obviously if CGDataProviderCopyData() is actually copying the data byte-for-byte, then I think there must be a faster way to directly access that data...it's just bytes in memory. Anyone know for sure if CGDataProviderCopyData() actually copies t...

UITableViewCell similar to one in "Things" app

Hi im looking (but cant find) for sample app that will show me how to implement UITableView with custom UITableViewCell that is similar to one in the Things app, with smooth animation from read-only view (that hides empty cells) to editable view that shows only cells that can be edited, and custom cell with multiline input with small im...

Default Sorting with Core Data

This could well be a real stupid question, but I can't seem to sort my Core Data fetched results in the order they were saved to the persistent store. Effectively, I don't want to sort them at all, but omitting the sort descriptors from the fetch request gets me into all kinds of trouble. Is what I'm trying to achieve here possible, or...

obj-c : iphone dateformatter in 12-hours clock format.

hi, i want in my application to use the 12 hour clock format so the user can write 15:00 for 3:00 pm so i don't need to create a button am and pm. Thanks ...

How to later assign value to optional attribute of NSManagedObject in a NSManagedObjectModel having Three NSManagedObjects which is already created ?

I am using coredata framework. In my NSManagedObjectModel i am using three entities that are Class, Student and Score where class and student have one-to-many & inverse relationship and Student and Score have also inverse but one-one relationship. Score entity has all optional attributes and having default '0' decimalVaue, which is not ...

Retrieve file size from web server

Looking for a way to retrieve a file size from a web server using cocoa/foundation. I know one can use NSURLconnection which will return NSURLResponse that contains the file size. Is there any other way to get the size. I'm looking for a synchronous way of doing it so when i do [myClass getsize] the size is returned. Thanks ...

Help moving multiple images at once with touches

Here is my problem: I am trying to move a puzzle piece around the screen and then connect to the other piece if they are in close proximity. I have achieved this, though it is perhaps a little odd the way I did. My problem though is that once they have connected, I can't figure out how to move them as one image, instead of two separate e...

how to set Custom attribute of NSManagedObject which is calculated from other attributes ?

I am using core data framework to manage objects.i have an entity which has several attributes of decimal types. Among them is attribute which is mathematically calculated from other attributes. Ex :- @interface Marks : NSManagedObject { } @property (nonatomic, retain) NSDecimalNumber * answerGradeA; @property (nonatomic, retain) NSDe...

[iPhone Obj-C] How to move a label with the wave of the iPhone?

The code below is from the book Beginning iPhone 3 Development, chapter 15, using the accelerometer to control a ball. I want to use a label instead of the ball, and only move in the x direction. However, I donno how to revise the code to achieve this goal. Can anyone please help me? THX so much!!!! - (id)initWithCoder:(NSCoder *)coder ...

dealloc on Background Thread

Is it an error to call dealloc on a UIViewController from a background thread? It seems that UITextView (can?) eventually call _WebTryThreadLock which results in: bool _WebTryThreadLock(bool): Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a s...

Basic problems (type inference or something else?) in Objective-C/Cocoa.

Hi, Apologies for how basic these questions are to some. Just started learning Cocoa, working through Hillegass' book, and am trying to write my first program (a GUI Cocoa app that counts the number of characters in a string). I tried this: NSString *string = [textField stringValue]; NSUInteger *stringLength = [string length]; NSStri...

C++ reference type as instance variable in Objective-C++

C++ reference types as instance variables are forbidden in Objective-C++. How can I work around this? ...

Trying to understand crash log output

I'm trying to understand debug output from a crash log. I have the following line from the crashlog: 22 FG 0x00022b94 0x1000 + 138132 I understand how to use atos on 0x00022b94 to get the source code location. What I would like to know is why the crash log helpfully splits that number into 0x1000 + 138132?...

[IPHONE] How can I loop through all subviews of a UIView, and their subviews and their subviews...

Hello, How can I loop through all subviews of a UIView, and their subviews and their subviews... Thank you. ...

Passing a pointer to an array to glGenBuffers

I'm currently passing an array to a function, then attempting to use glGenBuffers with the array that is passed to the function. I can't figure out a way to get glGenBuffers to work with the array that I've passed. I have a decent grasp of the basics of pointers, but this is beyond me. Buffers are generated (and deleted) elsewhere. I ca...

Circular NSSlider with stop (non-continuous)

I am not sure how to phrase this better as a title but I need to make an NSSlider that functions as a normal volume knob. At the moment it will spin around as many times as I hold the mouse down and move it around the control. I need it to stop at the "0" position and the "100" position, I cannot have it jumping from 0 to 100 when I dr...

Easy XPath question for iPhone

Hey guys! This is driving me NUTS! Here's my XML document <?xml version="1.0" encoding="UTF-8"?> <container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container"> <rootfiles> <rootfile full-path="content.opf" media-type="application/oebps-package+xml"/> </rootfiles> </container> All I want to do is get t...

Example: Objective C method alongside a php method

I am very used to javascript and php programing, and I just jumped into programing Objective C. After working with it for a few weeks, the methods still confused me, as to how it is passing params, and how the methods are named. Since I am used to php, I am used to seeing: function myFunc($param1, $param2, $param3, $param4) { retur...

Tab bar action problem

hi, hello,I want that i load a xib on tab click after condition check.where i put the condition in my code.i put in view did lode but not working.please help me ....... ...

Does "opening a file" mean loading it completely into memory?

There's an AudioFileOpenURL function which opens an file. With AudioFileReadPackets that file is accessed to read packets. But one thing that stucks in my brain is: Does AudioFileOpenURL actually load the whole monster into memory? Or is that a lightweight operation? So is it possible to read data from a file, only a specific portion, w...