Search Results

Search found 6745 results on 270 pages for 'objective'.

Page 1/270 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Objective-C with some Objective-C++, calling a normal c++ method "referenced from" problem

    - by xenonii
    Hi, I made an Objective-C project for the iPhone. I had only one cpp class, the soundEngine taken from some Apple demo. Now I'm trying to merge OpenFeint which is coded in Objective-C++. As soon as I drop in the code without even referring to it from my code, when I hit Build, my Objective-C code cannot find the methods of the cpp file. All the class files compile, but in the linking stage it says something like: "_SoundEngine_SetDisabled", referenced from: someClass.o Note that it is adding an underscore in front of the methods when it's reporting these linking errors. P.S. I know that for OpenFeint first thing one should do is convert the files to .mm but if possible I don't want to go down that road at this stage of development. I was going to try create a wrapper Objective-C++ class for it. I read someone managed to do that.

    Read the article

  • Is Objective-C++ a totally different language from Objective-C?

    - by Jake Petroules
    As the title says... are they considered different languages? For example if you've written an application using a combination of C++ and Objective-C++ would you consider it to have been written in C++ and Objective-C, C++ and Objective-C++ or all three? Obviously C and C++ are different languages even though C++ and C are directly compatible, how is the situation with Objective-C++ and Objective-C?

    Read the article

  • 3 tier architecture in objective-c

    - by hba
    I just finished reading the objective-c developer handbook from apple. So I pretty much know everything that there is to know about objective-c (hee hee hee). I was wondering how do I go about designing a 3-tier application in objective-c. The 3-tiers being a front-end application in Cocoa, a middle-tier in pure objective-c and a back-end (data access also in objective-c and mysql db). I'm not really interested in discussing why I'd need a 3-tier architecture, I'd like to narrow the discussion to the 'how'. For example, can I have 3 separate x-code projects one for each tier? If so how would I link the projects together. In java, I can export each tier as a jar file and form the proper associations.

    Read the article

  • Interpret Objective C scripts at runtime on iPhone?

    - by Brad Parks
    Is there anyway to load an objective c script at runtime, and run it against the classes/methods/objects/functions in the current iPhone app? The reason i ask is that I've been playing around with iPhone wax, a lua interpreter that can be embedded in an iPhone app, and it works very nicely, in the sense that any object/method/function that's publically available in your Objective C code is automatically bridged, and available in lua. This allows you to rapidly prototype applications by simply making the core of your app be lua files that are in the users documents directory. Just reload the app, and you can test out changes to your lua files without needing to rebuild the app in XCode - a big time saver! But, with Apples recent 3.1.3 SDK stuff, it got me thinking that the safest approach for doing this type of rapid prototypeing would be if you could use Objective C as the interpreted code... That way, worst case scenario, you could just compile it into your app before your release, instead. I have heard that the lua source can be compiled to byte code, and linked in at build time, but I think the ultimate safe thing would be if the scripted source was in objective c, not lua. This leads me to wondering (i've searched, but come up with nothing) if there are any examples on how to embed an Objective C Interpreter in an iPhone app? This would allow you to rapidly prototype your app against the current classes that are built into your binary, and, when your about to deploy your app, instead of running the classes through the in app interpreter, you compile them in instead.

    Read the article

  • Clang warning flags for Objective-C development

    - by Macmade
    As a C & Objective-C programmer, I'm a bit paranoid with the compiler warning flags. I usually try to find a complete list of warning flags for the compiler I use, and turn most of them on, unless I have a really good reason not to turn it on. I personally think this may actually improve coding skills, as well as potential code portability, prevent some issues, as it forces you to be aware of every little detail, potential implementation and architecture issues, and so on... It's also in my opinion a good every day learning tool, even if you're an experienced programmer. For the subjective part of this question, I'm interested in hearing other developers (mainly C, Objective-C and C++) about this topic. Do you actually care about stuff like pedantic warnings, etc? And if yes or no, why? Now about Objective-C, I recently completely switched to the LLVM toolchain (with Clang), instead of GCC. On my production code, I usually set this warning flags (explicitly, even if some of them may be covered by -Wall): -Wall -Wbad-function-cast -Wcast-align -Wconversion -Wdeclaration-after-statement -Wdeprecated-implementations -Wextra -Wfloat-equal -Wformat=2 -Wformat-nonliteral -Wfour-char-constants -Wimplicit-atomic-properties -Wmissing-braces -Wmissing-declarations -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wnewline-eof -Wold-style-definition -Woverlength-strings -Wparentheses -Wpointer-arith -Wredundant-decls -Wreturn-type -Wsequence-point -Wshadow -Wshorten-64-to-32 -Wsign-compare -Wsign-conversion -Wstrict-prototypes -Wstrict-selector-match -Wswitch -Wswitch-default -Wswitch-enum -Wundeclared-selector -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wwrite-strings I'm interested in hearing what other developers have to say about this. For instance, do you think I missed a particular flag for Clang (Objective-C), and why? Or do you think a particular flag is not useful (or not wanted at all), and why?

    Read the article

  • Objective-C As A First OOP Language?

    - by Daniel Scocco
    I am just finishing the second semester of my CS degree. So far I learned C, all the fundamental algorithms and data structures (e.g., searching, sorting, linked lists, heaps, hash tables, trees, graphs, etc). Next year we'll start with OOP, using either Java or C++. Recently I got some ideas for some iPhone apps and got itchy to start working on them. However I heard some bad things about Objectice-C in the past, so I am wondering if learning it as my first OOP language could be a problem. Not to mention that I think it will be hard to find books/online courses that teach basic OOP concepts using Objective-C to illustrate the concepts (as opposed to books using Java or C++, which are plenty), so this could be another problem. In summary: should I start learning Objective-C and OOP concepts right now by my own, or wait one more semester until I learn Java/C++ at university and then jump into Objective-C? Update: For those interested in getting started with OOP via Objective-C I just found some nice tutorials inside Apple's Developer Library - http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/OOP_ObjC/Introduction/Introduction.html

    Read the article

  • Strings in Objective-C++

    - by John Smith
    I just switched my code from Objective-C to Objective-C++. Everything goes swimmingly except for two lines. NSString * text1=[[NSString stringWithFormat:@"%.2f",ymax] UTF8String]; This line complains that error: cannot convert 'const char*' to 'NSString*' in initialization The second error related to the first is from the line: CGContextShowTextAtPoint(context, 2, 8, text1, strlen(text1)); It complains that error: cannot convert 'NSString*' to 'const char*' for argument '1' to 'size_t strlen(const char*)' Is there something I missed in the differences between ObjC and ObjC++?

    Read the article

  • C# Java Objective-C need expert advices

    - by Kevino
    Which platform as the edge today in 2012 with the rise of cloud computing, mobile development and the revolution of HTML5/Javascript between J2EE, .Net framework and IOS Objective-C ??? I want to start learning 1 language between Java, C# and Objective-C and get back into programming after 14 years and I don't know which to choose I need expert advices... I already know a little C++ and I remember my concepts in example pointers arithmetic, class etc so I tend to prefer learning C# and Objective-C but I've been told by some experienced programmers that Windows 8 could flop and .Net could be going away slowly since C++ and Html5/Javascript could be king in mobile is that true ? and that C# is more advanced compared to Java with Linq/Lambda... but not truly as portable if we consider android, etc but Java as a lot going for him too Scala, Clojure, Groovy, JRuby, JPython etc etc so I am lost Please help me, and don't close this right away I really need help and expert advices thanks you very much ANSWER : ElYusubov : thanks for everything please continue with the answers/explanations I just did some native C++ in dos mode in 1998 before Cli and .Net I don't know the STL,Templates, Win32 or COM but I remember a little the concept of memory management and oop etc I already played around a little with C# 1.0 in 2002 but things changed a lot with linq and lambda... I am here because I talked with some experienced programmers and authors of some the best selling programming books like apress wrox and deitel and they told me a few things are likely to happen like .Net could be on his way out because of Html5/Javascript combo could kill xaml and C++ native apps on mobile dev will outperform them by a lot... Secondly ios and android are getting so popular that mobile dev is the future so Objective-C is very hard to ignore so why get tied down in Windows long term (.Net) compared to Java (android)... but again android is very fragmented, they also said Windows 8 RT will give you access to only a small part of the .Net framework... so that's what they think so I don't know which direction to choose I wanted to learn C# & .Net but what if it die off or Windows 8 flop Windows Phone marketshare really can't compare to ios... so I'll be stuck that's why I worry is Java safer long term or more versatile if you want 'cause of the support for android ??

    Read the article

  • Objective-C or C++ for iOS games?

    - by Martin Wickman
    I'm pretty confident programming in Objective-C and C++, but I find Objective-C to be somewhat easier to use and more flexible and dynamic in nature. What would be the pros and cons when using C++ instead of Obj-C for writing games in iOS? Or rather, are there any known problems with using Obj-C as compared to C++? For instance, I suspect there might be performance issues with Obj-C compared to code written in C/C++.

    Read the article

  • how to return C++ pointer in objective-C++

    - by John Smith
    I have the following objective-C++ header with the simple method to return this pointer. @interface MyObj { MyCPPObj * cpp; } -(MyCPPObj *) getObj; I have created the simple method @implementation MyObj -(MyCPPObj *) getObj { return cpp; } Everything seems to work until I actually try to use the object in another file newObj = [createdMyObj getObj]; It complains: error: cannot convert 'objc_object*' to 'MyCPPObje *' in initialization. It seems that the method is return an objective-c object, but I specifically requested a C++ pointer. How can I fix that?

    Read the article

  • Blocking access to websites with objective-C / root privileges in objective-C

    - by kvaruni
    I am writing a program in Objective-C (XCode 3.2, on Snow Leopard) that is capable of either selectively blocking certain sites for a duration or only allow certain sites (and thus block all others) for a duration. The reasoning behind this program is rather simple. I tend to get distracted when I have full internet access, but I do need internet access during my working hours to get to a number of work-related websites. Clearly, this is not a permanent block, but only helps me to focus whenever I find myself wandering a bit too much. At the moment, I am using a Unix script that is called via AppleScript to obtain Administrator permissions. It then activates a number of ipfw rules and clears those after a specific duration to restore full internet access. Simple and effective, but since I am running as a standard user, it gets cumbersome to enter my administrator password each and every time I want to go "offline". Furthermore, this is a great opportunity to learn to work with XCode and Objective-C. At the moment, everything works as expected, minus the actual blocking. I can add a number of sites in a list, specify whether or not I want to block or allow these websites and I can "start" the blocking by specifying a time until which I want to stay "offline". However, I find it hard to obtain clear information on how I can run a privileged Unix command from Objective-C. Ideally, I would like to be able to store information with respect to the Administrator account into the Keychain to use these later on, so that I can simply move into "offline" mode with the convenience of clicking a button. Even more ideally, there might be some class in Objective-C with which I can block access to some/all websites for this particular user without needing to rely on privileged Unix commands. A third possibility is in starting this program with root permissions and the reducing the permissions until I need them, but since this is a GUI application that is nested in the menu bar of OS X, the results are rather awkward and getting it to run each and every time with root permission is no easy task. Anyone who can offer me some pointers or advice? Please, no security-warnings, I am fully aware that what I want to do is a potential security threat.

    Read the article

  • Objective C and C++ for Game Development

    - by Holland
    I'm trying to figure out which language I should begin learning. I've only been programming for about 6 months, with languages like PHP, Java, and C#. I want to learn how to dev games, and while I know in most cases the answer to this would be through C++ (at least, I would think), though I'm still curious about what Objective C can offer in the sense of long term benefit. It seems like there's a chance that Objective-C may actually become more popular than C++ in a few years, and for all I know, it may become the de facto standard development language for games. Still, despite all of this, I really don't know anything, and this is all speculation. Both languages seem very interesting, and obviously can pull a lot of out of themselves. What do you think? Note: despite what some might say, I really don't want to end up using prebuilt engines, and would rather just learn how to make my own. I'm well aware that it takes a lot more time, but I'm quite ok with that.

    Read the article

  • Objective C ASIHTTPRequest nested GCD block in complete block

    - by T.Leavy
    I was wondering if this is the correct way to have nested blocks working on the same variable in Objective C without causing any memory problems or crashes with ARC. It starts with a ASIHttpRequest complete block. MyObject *object = [dataSet objectAtIndex:i]; ASIHTTPRequest *request = [[ASIHTTPRequest alloc]initWithURL:@"FOO"]; __block MyObject *mutableObject = object; [request setCompleteBlock:^{ mutableObject.data = request.responseData; __block MyObject *gcdMutableObject = mutableObject; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0),^{ [gcdMutableObject doLongComputation]; dispatch_async(dispatch_get_main_queue(),^{ [self updateGUIWithObject:gcdMutableObject]; }); }); [request startAsynchronous]; My main concern is nesting the dispatch queues and using the __block version of the previous queue to access data. Is what I am doing safe?

    Read the article

  • Mixing Objective-C and C++

    - by helixed
    Hello, I'm trying to mix together some Objective-C code with C++. I've always heard it was possible, but I've never actually tried it before. When I try to compile the code, I get a bunch of errors. Here's a simple example I've created which illustrates my problems: AView.h #import <Cocoa/Cocoa.h> #include "B.h" @interface AView : NSView { B *b; } -(void) setB: (B *) theB; @end AView.m #import "AView.h" @implementation AView - (id)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { // Initialization code here. } return self; } - (void)drawRect:(NSRect)dirtyRect { // Drawing code here. } -(void) setB: (B *) theB { b = theB; } @end B.h #include <iostream> class B { B() { std::cout << "Hello from C++"; } }; Here's the list of errors I get when I try to compile this: /Users/helixed/Desktop/Example/B.h:1:0 /Users/helixed/Desktop/Example/B.h:1:20: error: iostream: No such file or directory /Users/helixed/Desktop/Example/B.h:3:0 /Users/helixed/Desktop/Example/B.h:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'B' /Users/helixed/Desktop/Example/AView.h:5:0 /Users/helixed/Desktop/Example/AView.h:5: error: expected specifier-qualifier-list before 'B' /Users/helixed/Desktop/Example/AView.h:8:0 /Users/helixed/Desktop/Example/AView.h:8: error: expected ')' before 'B' /Users/helixed/Desktop/Example/AView.m:26:0 /Users/helixed/Desktop/Example/AView.m:26: error: expected ')' before 'B' /Users/helixed/Desktop/Example/AView.m:27:0 /Users/helixed/Desktop/Example/AView.m:27: error: 'b' undeclared (first use in this function) All I'm doing to compile this right now is using the default compiler built into Xcode. I didn't edit the Cocoa Application template in any way other than adding the two files I created and chaing the NSView to AView in the xib file. Could somebody please tell me what I'm doing wrong? Thanks, helixed

    Read the article

  • Mixing Objective-C and C++

    - by helixed
    I'm trying to mix together some Objective-C code with C++. I've always heard it was possible, but I've never actually tried it before. When I try to compile the code, I get a bunch of errors. Here's a simple example I've created which illustrates my problems: AView.h #import <Cocoa/Cocoa.h> #include "B.h" @interface AView : NSView { B *b; } -(void) setB: (B *) theB; @end AView.m #import "AView.h" @implementation AView - (id)initWithFrame:(NSRect)frame { self = [super initWithFrame:frame]; if (self) { // Initialization code here. } return self; } - (void)drawRect:(NSRect)dirtyRect { // Drawing code here. } -(void) setB: (B *) theB { b = theB; } @end B.h #include <iostream> class B { B() { std::cout << "Hello from C++"; } }; Here's the list of errors I get when I try to compile this: /Users/helixed/Desktop/Example/B.h:1:0 /Users/helixed/Desktop/Example/B.h:1:20: error: iostream: No such file or directory /Users/helixed/Desktop/Example/B.h:3:0 /Users/helixed/Desktop/Example/B.h:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'B' /Users/helixed/Desktop/Example/AView.h:5:0 /Users/helixed/Desktop/Example/AView.h:5: error: expected specifier-qualifier-list before 'B' /Users/helixed/Desktop/Example/AView.h:8:0 /Users/helixed/Desktop/Example/AView.h:8: error: expected ')' before 'B' /Users/helixed/Desktop/Example/AView.m:26:0 /Users/helixed/Desktop/Example/AView.m:26: error: expected ')' before 'B' /Users/helixed/Desktop/Example/AView.m:27:0 /Users/helixed/Desktop/Example/AView.m:27: error: 'b' undeclared (first use in this function) All I'm doing to compile this right now is using the default compiler built into Xcode. I didn't edit the Cocoa Application template in any way other than adding the two files I created and chaing the NSView to AView in the xib file. Could somebody please tell me what I'm doing wrong? Thanks, helixed

    Read the article

  • Noob Objective-C/C++ - Linker Problem/Method Signature Problem

    - by Josh
    There is a static class Pipe, defined in C++ header that I'm including. The static method I'm interested in calling (from Objetive-c) is here: static ERC SendUserGet(const UserId &_idUser,const GUID &_idStyle,const ZoneId &_idZone,const char *_pszMsg); I have access to an objetive-c data structure that appears to store a copy of userID, and zoneID -- it looks like: @interface DataBlock : NSObject { GUID userID; GUID zoneID; } Looked up the GUID def, and its a struct with a bunch of overloaded operators for equality. UserId and ZoneId from the first function signature are #typedef GUID Now when I try to call the method, no matter how I cast it (const UserId), (UserId), etc, I get the following linker error: Ld build/Debug/Seeker.app/Contents/MacOS/Seeker normal i386 cd /Users/josh/Development/project/Mac/Seeker setenv MACOSX_DEPLOYMENT_TARGET 10.5 /Developer/usr/bin/g++-4.2 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -L/Users/josh/Development/TS/Mac/Seeker/build/Debug -L/Users/josh/Development/TS/Mac/Seeker/../../../debug -L/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/gcc/i686-apple-darwin10/4.2.1 -F/Users/josh/Development/TS/Mac/Seeker/build/Debug -filelist /Users/josh/Development/TS/Mac/Seeker/build/Seeker.build/Debug/Seeker.build/Objects-normal/i386/Seeker.LinkFileList -mmacosx-version-min=10.5 -framework Cocoa -framework WebKit -lSAPI -lSPL -o /Users/josh/Development/TS/Mac/Seeker/build/Debug/Seeker.app/Contents/MacOS/Seeker Undefined symbols: "SocPipe::SendUserGet(_GUID const&, _GUID const&, _GUID const&, char const*)", referenced from: -[PeoplePaneController clickGet:] in PeoplePaneController.o ld: symbol(s) not found collect2: ld returned 1 exit status Is this a type/function signature error, or truly some sort of linker error? I have the headers where all these types and static classes are defined #imported -- I tried #include too, just in case, since I'm already stumbling :P Forgive me, I come from a web tech background, so this c-style memory management and immutability stuff is super hazy. Edit: Added full linker error text. Changed "function" to "method" Thanks, Josh

    Read the article

  • Creating an Objective-C++ Static Library in Xcode

    - by helixed
    So I've developed an engine for the iPhone with which I'd like to build a couple different games. Rather than copy and paste the files for the engine inside of each game's project directory, I'd a way to link to the engine from each game, so if I need to make a change to it I only have to do so once. After reeding around a little bit, it seems like static libraries are the best way to do this on the iPhone. I created a new project called Skeleton and copied all of my engine files over to it. I used this guide to create a static library, and I imported the library into a project called Chooser. However, when I tried to compile the project, Xcode started complaining about some C++ data structures I included in a file called ControlScene.mm. Here's my build errors: "operator delete(void*)", referenced from: -[ControlScene dealloc] in libSkeleton.a(ControlScene.o) -[ControlScene init] in libSkeleton.a(ControlScene.o) __gnu_cxx::new_allocator<operation_t>::deallocate(operation_t*, unsigned long)in libSkeleton.a(ControlScene.o) __gnu_cxx::new_allocator<operation_t*>::deallocate(operation_t**, unsigned long)in libSkeleton.a(ControlScene.o) "operator new(unsigned long)", referenced from: -[ControlScene init] in libSkeleton.a(ControlScene.o) __gnu_cxx::new_allocator<operation_t*>::allocate(unsigned long, void const*)in libSkeleton.a(ControlScene.o) __gnu_cxx::new_allocator<operation_t>::allocate(unsigned long, void const*)in libSkeleton.a(ControlScene.o) "std::__throw_bad_alloc()", referenced from: __gnu_cxx::new_allocator<operation_t*>::allocate(unsigned long, void const*)in libSkeleton.a(ControlScene.o) __gnu_cxx::new_allocator<operation_t>::allocate(unsigned long, void const*)in libSkeleton.a(ControlScene.o) "___cxa_rethrow", referenced from: std::_Deque_base<operation_t, std::allocator<operation_t> >::_M_create_nodes(operation_t**, operation_t**)in libSkeleton.a(ControlScene.o) std::_Deque_base<operation_t, std::allocator<operation_t> >::_M_initialize_map(unsigned long)in libSkeleton.a(ControlScene.o) "___cxa_end_catch", referenced from: std::_Deque_base<operation_t, std::allocator<operation_t> >::_M_create_nodes(operation_t**, operation_t**)in libSkeleton.a(ControlScene.o) std::_Deque_base<operation_t, std::allocator<operation_t> >::_M_initialize_map(unsigned long)in libSkeleton.a(ControlScene.o) "___gxx_personality_v0", referenced from: ___gxx_personality_v0$non_lazy_ptr in libSkeleton.a(ControlScene.o) ___gxx_personality_v0$non_lazy_ptr in libSkeleton.a(MenuLayer.o) "___cxa_begin_catch", referenced from: std::_Deque_base<operation_t, std::allocator<operation_t> >::_M_create_nodes(operation_t**, operation_t**)in libSkeleton.a(ControlScene.o) std::_Deque_base<operation_t, std::allocator<operation_t> >::_M_initialize_map(unsigned long)in libSkeleton.a(ControlScene.o) ld: symbol(s) not found collect2: ld returned 1 exit status If anybody could offer some insight as to why these problems are occuring, I'd appreciate it. Thanks, helixed

    Read the article

  • Objective-C++ compiles for iPhone, but not simulator

    - by John Smith
    I have a C++ library I want to add to my iphone project. In one header file I declare @class a { cppvirtualclass V; } This compiles fine for the iPhone device with Release settings. However it refuses to compile for the Simulator with or without debug info. It give the error error: type 'V' has virtual member functions. Is there a way out of this or do I have to define only concrete C++ classes?

    Read the article

  • Building Dynamic Classes in Objective C

    - by kjell_
    I'm a somewhat competent ruby programmer. Yesterday I decided to finally try my hand with Apple's Cocoa frameworks. Help me see things the ObjC way? I'm trying to get my head around objc_allocateClassPair and objc_registerClassPair. My goal is to dynamically generate a few classes and then be able to use them as I would any other class. Does this work in Obj C? Having allocated and registered class A, I get a compile error when calling [[A alloc] init]; (it says 'A' Undeclared). I can only instantiate A using runtime's objc_getClass method. Is there any way to tell the compiler about A and pass it messages like I would NSString? A compiler flag or something? I have 10 or so other classes (B, C, …), all with the same superclass. I want to message them directly in code ([A classMethod], [B classMethod], …) without needing objc_getClass. Am I trying to be too dynamic here or just botching my implementation? It looks something like this… NSString *name = @"test"; Class newClass = objc_allocateClassPair([NSString class], [name UTF8String], 0); objc_registerClassPair(newClass); id a = [[objc_getClass("A") alloc] init]; NSLog(@"new class: %@ superclass: %@", a, [a superclass]); //[[A alloc] init]; blows up.

    Read the article

  • Problem with accessing variables/functions from subclass Objective C

    - by Mitul Ruparelia
    Hi, I am having a problem with accessing public variable 'activity', which is a UIActivityIndicatorView type, see class declaration below in QuickStartViewController.h: @interface QuickStartViewController : UIViewController <ABPeoplePickerNavigationControllerDelegate> { @public IBOutlet UIActivityIndicatorView *activity; } @property (nonatomic, retain) UIActivityIndicatorView *activity; @end The function is called from another class: #import "QuickStartViewController.h" @interface NumberValidator : QuickStartViewController.... See below: - (void)connectionDidFinishLoading:(NSURLConnection *)connection { [activity startAnimating]; NSLog(@"This function is called, but [activity startAnimating] still doesn't work..."); } Note: [activity startAnimating] works fine when called within the QuickStartViewController class Do you have any suggestions as to why [activity startAnimating] is not working?

    Read the article

  • Objective-C++ pre-compiled headers

    - by KayEss
    I'm using a C++ library (it happens to be in an iPad application, but I'm not sure that should make any difference) and would really like to have the headers pre-compiled to speed up the builds, but xCode seems to run the pre-compiled header file through the C compiler rather than the C++ one. Is there a way to get it to use the right compiler? I've already changed all of my source files from .m to .mm.

    Read the article

  • Objective-C, .m / .mm performance difference?

    - by Sam
    I tend to use the .mm extension by default when creating new classes so that I can use ObjC++ later on if I require it. Is there any disadvantage to doing this? When would you prefer .m? Does .m compile to a faster executable (since C is generally faster than C++)?

    Read the article

  • Noob Objective-C/C++ - Linker Problem/Function Def Problem

    - by Josh
    There is a static class Pipe, defined in C++ header that I'm including. The function I'm interested in calling (from Objetive-c) is here: static ERC SendUserGet(const UserId &_idUser,const GUID &_idStyle,const ZoneId &_idZone,const char *_pszMsg); I have access to an objetive-c data structure that appears to store a copy of userID, and zoneID -- it looks like: @interface DataBlock : NSObject { GUID userID; GUID zoneID; } Looked up the GUID def, and its a struct with a bunch of overloaded operators for equality. UserId and ZoneId from the first function signature are #typedef GUID Now when I try to call the function, no matter how I cast it (const UserId), (UserId), etc, I get the following linker error: "Pipe::SendUserGet(_GUID const&, _GUID const&, _GUID const&, char const*)", referenced from: -[PeoplePaneController clickGet:] in PeoplePaneController.o Is this a type/function signature error, or truly some sort of linker error? I have the headers where all these types and static classes are defined #imported -- I tried #include too, just in case, since I'm already stumbling :P Forgive me, I come from a web tech background, so this c-style memory management and immutability stuff is super hazy. Thanks, Josh

    Read the article

  • Copying a directory off a network drive using Objective-C/C

    - by Jeff
    Hi All, I'm trying to figure out a way for this to work: NSString *searchCommand = [[NSString alloc] initWithFormat:@"cp -R /Volumes/Public/DirectoryToCopy* Desktop/"]; const char* system_call = [searchCommand UTF8String]; system(system_call); The system() method does not acknowledge the specific string I am passing in. If I try something like: system("kextstat"); No problems. Any ideas why the find string command I'm passing in is not working? All I get is "GDB: Running ....." in xCode. I should mention that if I try the same exact command in terminal it works just fine.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >