Box 2d Archives

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

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

We can convert a CLLocation object to a CLLocationCoordinate2D object using the coordinate property of the CLLocation object. This can be done as follows :

 

Consider a CLLocation object name myLocation. Now we can get the equivalent CLLocationCoordinate2D of myLocation as,

 

CLLocationCoordinate2D myCoordinate = myLocation.coordinate;

 

We can obtain the latitude and longitude of a CLLocationCoordinate2D object using its latitude and longitude properties.

 

i.e.,

double myLatitude = myCoordinate.latitude; // this will give the latitude value of the coordinate

double myLongitude = myCoordinate.longitude;// this will give the longitude value of the coordinate

Incoming search terms:

  • CLLocationCoordinate2D to cllocation
  • cllocation CLLocationCoordinate2D
  • cllocation to cllocationcoordinate2d
  • convert cllocation to cllocationcoordinate2d
  • ios CLLocationCoordinate2D与CLLocation
  • xcode cllocationcoordinate2d latitude
  • xcode cllocation from coordinates
  • ios develop CLLocation CLLocationCoordinate2D
  • how to convert cllocationcoordinate2d to cllocation
  • how to convert cllocation to double in ios

It is possible to initialize a CLLocation object with a latitude and longitude in Xcode. Consider two float values corresponding to the latitude and longitude value you want to use, as follows :

 

double your_latitiude_value = 8.391916;

double your_longitude_value = 77.094315;

 

We can initialize a CLLocation object using these latitude and longitude values as follows :

 

CLLocation *myLocation = [[CLLocation alloc] initWithLatitude:your_latitiude_value longitude:your_longitude_value];

Incoming search terms:

  • xcode howto enable cllocation
  • cllocationmanager iphone xcode
  • get latitude longitude cllocationcoordinate2d
  • how to create cllocation object
  • ios CoreLocation make CLLocation from latitude longitude
  • xcode cllocation with latitude longitude
  • xcode howto cllocation google by address
  • xcode latitude longitude from address google

It is possible to get the rootviewcontroller of the project from within a class or scene in cocos2d using Xcode. This can be done using the nextResponder method of the OpenGLview of cocos2d director. It can be implemented as follows :

 

 

 

UIViewController *rootViewController = (UIViewController *)[[[CCDirector sharedDirector] openGLView] nextResponder];

 

In this, the rootViewController object will contain the original root view controller of the project.

Incoming search terms:

  • cocos2d 2 0 rootviewcontroller
  • cocos2d-x get rootviewcontroller
  • cocos2d-x view controller
  • viewcontroller for cocos2d-x
  • get rootviewcontroller cocos2d-x
  • cocos2dx viewController
  • cocos2dx get rootviewcontroller
  • cocos2d-x viewcontroller scene
  • cocos2d viewcontroller iad
  • xcode root view controller news

How to include and use new fonts in iPhone SDK?

  1. Add the font files to your resource files
  2. Edit your Info.plist: Add a new entry with the key Fonts provided by application.
  3. For each of your files, add the file name to this array

In your application you can the use [UIFont fontWithName:@"YourFontName" size:14.f].

Note: this is available in iOS 3.2 and later.

Joints in Box2d

Joints

Box2D has a number of ‘joints’ that can be used to connect two bodies together. These joints can be used to simulate interaction between objects to form hinges, pistons, ropes, wheels, pulleys, vehicles, chains, etc. Learning to use joints effectively helps to create a more engaging and interesting scene.

Here are the joints in Box2D v2.1.2:

  • Revolute – a hinge or pin, where the bodies rotate about a common point
  • Distance – a point on each body will be kept at a fixed distance apart
  • Prismatic – the relative rotation of the two bodies is fixed, and they can slide along an axis
  • Line – a combination of revolute and prismatic joints, useful for modelling vehicle suspension
  • Weld – holds the bodies at the same orientation
  • Pulley – a point on each body will be kept within a certain distance from a point in the world,
    where the sum of these two distances is fixed, kinda… (sheesh… there is no succinct way to describe this)
  • Friction – reduces the relative motion between the two bodies
  • Gear – controls two other joints (revolute or prismatic) so that the movement of one affects the other
  • Mouse – pulls a point on one body to a location in the world
Joints added after v2.1.2:

  • Wheel – the line joint, renamed
  • Rope – a point on each body will be constrained to a maximum distance apart

To fix the orientation issue in IOS6 while using Cocos2d, perform the following :

 

Inside AppDelegate.m file

Replace the following line of code

[window addSubview: viewController.view];

With the following lines of code

if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0)

{

// Note : addSubView doesn’t work on IOS6

[window addSubview: viewController.view];

}

else

{

// For IOS6, use this method

[window setRootViewController:viewController];

}

Now inside RootViewController.m file

// For IOS6, use supportedInterfaceOrientations & shouldAutorotate instead of shouldAutorotateToInterfaceOrientation

- (NSUInteger) supportedInterfaceOrientations{

return UIInterfaceOrientationMaskLandscape;

}

- (BOOL) shouldAutorotate {

return YES;

}

That is it. The orientation issue will be fixed now.

Note : If your application supports for IOS versions less than 6.0, then you can keep the shouldAutorotateToInterfaceOrientation method.

Incoming search terms:

  • cocos2d ios 6 rotation
  • cocos2d uidevice ios6
  • cocos2d x ios 6 orientation
  • cocos2d-x orientation ios6
  • ios6 shouldAutoRotate
  • uimodaltransitionstylepartialcurl height

Getting Device IOS Version in Xcode

To get the current running device IOS version  using Xcode, use the following code :

[[UIDevice currentDevice].systemVersion floatValue]

The resultant value will be a floating value.

For example, for IOS6, the above code will return the value 6.0

 

Page 1 of 2212345...1020...Last »