Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2017, 11:41:39 PM
Home Help Search chat Login Register   
News: Read this please.The Great Kangaroo Escape Looking for reviews of the 4th ed on Amazon!   Twitter:  @skochan

+  Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
|-+  Recent Posts
Pages: [1] 2 3 ... 10

 1 
 on: April 19, 2017, 01:15:07 AM 
Started by clouded - Last post by LavrinPristazh
In the 7th version of Xcode, you should type"clang -fobjc-arc copy.m -o copy" to compile in the Terminal.

 2 
 on: April 05, 2017, 03:11:30 AM 
Started by tleoncio - Last post by LWhisley
I am having no problems maybe their server was down try again if still nothing then uninstall and reinstall it maybe a file got corrupted

 3 
 on: February 24, 2017, 06:50:44 AM 
Started by pif - Last post by nunof32
Hello,

I just posted something very similar to this (Feb. 24, 2017) before I noticed your post.

I think your concern is valid. Have you had a full explanation on how and why this works (or not).

Regards,

nunof32

 4 
 on: February 24, 2017, 06:44:33 AM 
Started by nunof32 - Last post by nunof32
Hello, I'm trying to learn Objective-C and am stuck in Chapter 8. Would appreciate if someone can get me out of the rut.

My worries concern Class Rectangle that is introduced in this chapter (Cool.

1. First I'm troubled by the fact that nowhere is it said that Properties height and width of Rectangle must not be negative. If they can be negative, the definition of Property origin (coordinates of the lower left corner of the rectangle) makes that origin has to be recomputed (and the negative values of height / with converted to positives) each time height and width are (re)set. There are also a number of interesting complications if the user sets first the height and the width of the rectangle before setting its origin.

To avoid these complications I would like to ensure that height and width are >= 0. But as author Kochan has imposed earlier that these Properties are @synthesized I assume that the author does not wish that I tinker with their accessor methods ...

Any views on this ?

2. More fundamental : setOrigin method implementation. The book usefully highlights the problem that can occur if this method just copies into origin (which is a pointer) the parameter pt (also a pointer) that is passed to it : both pointers point to the same values and if the values that pt points to are changed so will the values that origin points to.

The book says that the solution is for the instance to own its own origin XYPoint. This is achieved through a preliminary statement at the beginning of the method

origin = [[XYPoint] alloc] init];

Very well. Now we have created our own XYPoint which origin points to.

My problem is that this looks strange. The statement is put inside the setOrigin method. Presumably, the XYPoint that it creates is created in memory space that belongs to the method for the duration of its execution. By the time the method returns, this space is reverted to the 'space unused' pool and nothing guarantees us that the space where the x and y property values of origin are stored will not be overwritten by someone else.

I would have thought that the right solution would be to make the allocation / initialization of the variable along with its declaration in this way :

@interface : Rectangle
{
   XYPoint origin * = [[XYPoint alloc] init]];
}

but this is not allowed.


Can someone please shed some light into this ?

Many thanks in advance.

 5 
 on: January 25, 2017, 02:45:48 AM 
Started by eagle74 - Last post by Jamepoison

Read the story here. It is knowledge that is very useful for me and for many people.

 6 
 on: December 04, 2016, 06:49:37 PM 
Started by JRIH - Last post by JRIH
Using Objective-C 6th edition and Xcode 6.3.
When I try to type in the initial program, into the different files: main.m Fraction.h and Fraction.m, I get error messages all over the place.
The Fraction.m file is actually named NSObject+Fraction.m. and inside it says to #import "NSObject+Fraction.h".
in main.m, when I put in Fraction *myfraction = [[Fraction alloc] init];, i get a warning that says "Fraction is undeclared".  I did put in the entire program before looking at the warnings.
These are just a couple of examples of many.
I followed the chapter 2 and Chapter 7 instructions, but nothing is going right.  I hope you can help me and let me know any further information that you may need.


 7 
 on: November 10, 2016, 08:54:20 PM 
Started by blur - Last post by blur
750+ downloads as of today!! Shocked Not a huge success.. but I'll take it..

Pages: [1] 2 3 ... 10


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents (c) 2009 classroomM.com. All rights reserved.