Cocos2d Archives

How to convert a NSString value to NSData

You can do it as follows:

Create UIPickerView programmatically: cocos2d

In .h file:

In .m file:

Create UISegmentedControl programatically

You can create an UISegmented control in a cocos2d or Xcode project with the help of following lines code:

// Create an UIView

// Create the segmented control label array

// Create the UISegmentedControl and add to the UIView

Create UISwitch programatically

You can create an UIswitch in cocos2d or Xcode programatically with the help of following lines of code:

// Create an UIView

// Create the switch and add to the UIView

// Call function to get state

The common undefined symbol error appearing while integrating test flight will be something like the following :

Undefined symbols for architecture armv7s:

“_deflateInit_”, referenced from:

_compress_data in libTestFlight.a(tf_compression.o)

“_deflateEnd”, referenced from:

_compress_data in libTestFlight.a(tf_compression.o)

“_deflate”, referenced from:

_compress_data in libTestFlight.a(tf_compression.o)

ld: symbol(s) not found for architecture armv7s

clang: error: linker command failed with exit code 1 (use -v to see invocation)

 

The fix for this issue is simple.

Goto the build phases of the target for which the issue is appearing. In the link binary with libraries section, use the ‘+’ button at the bottom to add a new library. In the dialog box which appears, search for libz.dylib . You will see the library in the list. Select that and press the ‘Add’ button.

Now perform a build clean for the project and you are done.

Build the app and the issue will be fixed.

Incoming search terms:

  • _compress_data in libtestflight a(tf_compression o)
  • bfmuavrmput
  • Undefined symbols for architecture armv7s: _deflateInit2_ referenced from
  • testflight _deflate referenced from
  • in libtestflight a
  • how to make dialog box using cocos2dx
  • cocos2dx uicontroller
  • cocos2dx ios6 fadeout problem
  • cocos2d web
  • cocos2d test web

You can change/disable the highlight color of a table cell using the following codes…

Incoming search terms:

  • disable determine cell xcode
  • how to highlight a table cell with an image in xcode
  • xcode highlight a table cell using code
  • xcode remove selection from table
  • xcode table change selection color ios 6

We can get the child view controllers of a view controller using the childViewControllers property of the view controller.

If we are in a view controller class, if we want to get its child view controllers, then we can use the following code :

self.childViewControllers;

This will return an array of view controllers that are the child of the current view controller.

If there are no child view controllers of the current view controller, then the array will be empty.

 

If we are to get the child view controllers of a navigation controller, we can use the following code :

self.navigationController.childViewControllers;

Incoming search terms:

  • current childview controller
  • access child view in titanium
  • AppleMAC|Web eCommerce iOS Android ArduinoandSEO
  • how to find a view\s viewcontroller in childviewcontrollers array
  • xcode child view controller
  • xcode get child of navigation controller
  • xcode parent and child view

It is possible to pass a single parameter to performSelector: method in Xcode using the following method :

 

[self performSelector:@selector(selectorNamewithArg:) withObject:param];

 

But what to do if we have to pass multiple parameters? There is a way to pass upto two parameters to the performSelector: method. It can be implemented using the following method :

 

[self performSelector:@selector(selectorNamewithArg1: Arg2:) withObject:param1 withObject:param2];

 

Here, two parameters are passed to the selector method.

 

Incoming search terms:

  • xcode multiple arguments

How to change sprite’s speed dynamically?

You have to use a CCSpeed action:

CCSpeed* speed= [CCSpeed actionWithAction: yourMoveAction speed: 1.0f];

// yourMoveAction is an action like CCMoveTo for example

[sprite runAction: speed];

Then you can change the speed while the sprite moves with setSpeed:

[speed setSpeed: 2.0f];

Incoming search terms:

  • how to change a sprites speed
  • objective-c sprite speed

First Assign the string to an id:

Then call the scene transition with that id:

Incoming search terms:

  • cocos2d change scene class
Page 1 of 4212345...102030...Last »