samedi 31 janvier 2015

Check if app is iPhone opened on iPad

I have developed keyboard for iOS 8. Depending on if device is iPhone or iPad i load different layouts. Now, i have an issue when user opening app which is iPhone app but downloaded on iPad and of course iPad resizes this app. My keyboard detects device as an iPad and loads layout for iPad but as the app is not and iPad app, loaded keyboard layout is not suitable for it. Shortly, Is there any way to check programmatically if app is iPhone app resized by iPad? So i can load proper keyboard layout for it.




UIScrollView with UITableView / UICollectionView zooming issue

What i want to achieve : I want to creating scrolling list of images like a comic strip where i should be able to provide pinch and zoom. It can contain 100 images.


What i have tried :




  1. UIScrollView -> UIView -> UIImageView : The problem in this approach is that i get the zooming effect but the time taken to create the strip is around 5 sec and the memory consumption of the app becomes high.




  2. UIScrollView -> UIView -> UITableView -> UITableViewCell -> UIImageView : This resolves loading issue , memory issue . But the problem is with Zooming . I cannot achieve the same effect of Zooming on UITableView. I added the pinch gesture on the UITableView it zooms and scrolls vertically but horizontal effect is not achieved.




  3. UICollectionView -> UIImageView : This also resolves loading issue , memory issue but has same problem with zooming as it zooms a particular cell but after zooming to certain effect the cell disappears . And its also not uniformly applied to all UICollectionViewCells.




Any reference or code or idea's really appreciated.




converting ios 3rd parth APIS to 64bit architecture

i am new in ios development and now days working on an app that has been designed in 32 bit architecture with lots of 3rd party apis and cocopods usage in it.


As apple has decided to move all the apps to 64-bit architecture, i'm unable to figure out if there's any api in my code that's not following the rules and is still in 32bit architecture.


is there any way to check that and to convert them for 64bit architecture support.???




Parse function getObjectInBackgroundWithId saving anything in the database

I have a block of code that will update information in the Parse database. I set up an action so that when the information is saved, it gets updated in the background. the function is being executed, but its not saving anything back to the database. its going through the function, but no changes are being saved. The changed values are inside a text field and a switch.





- (IBAction)save:(id)sender {
NSLog(@"classnameinsave %@", self.productTitleField.text);
PFQuery *query = [PFQuery queryWithClassName:self.className];


[query getObjectInBackgroundWithId:self.productId block:^(PFObject *object, NSError *error) {
NSLog(@"inside getObjectsInBackgroundWithId function");
NSLog(@"priceinsave %@", object[@"price"]);
object[@"title"] = self.productTitleField.text;

object[@"price"] = self.priceField;

object[@"quantity"] = self.quantityField;
object[@"show"] = self.show;
[object saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
if(succeeded){
NSLog(@"Succeeded in Saving");
}else if(error){
NSLog(@"Error with saving changes %@", error);
}
}];
}];
}





How to test if SSL/TLS connection to a browser and to mobile devices? [on hold]

I'm novel QA and I wanted to ask you how can I test a SSL/TLS connection for a Java project?



  • How can I'm be sure that the communication established with a browser or a mobile device (android/iphone) is actually encripted?

  • How can I be sure that it won't be possible to do a man-in-the-middle attack?

  • Could you please recommend open tools to test this?

  • Could be possible to integrate these test as unit test?

  • Is it possible to (in some how) automated test for SSL and execute them with Jenkins?




IOS App Submission Routing App

I am trying to submit my app for review in Itunes Connect, but when I try to submit it I get an error saying


"To confifugre this app as an IOS routing app, upload a routing app coverage file on the app's Version page in My Apps on iTunes Connect. To configure your app as an IOS routing app, the app's Info.plist must contain the MKDirectionsApplicationSupportedModes key."


So in my project, in the Capabilities, the Maps is turned off. I do have the MapKit.framework in my project, as I do utilize the map, however I do not ever show routing information nor provide it in my app. Is the fact that this framework in my project causing this Itunes Connect error, and if so, how do I go about fixing it. And by fixing it, I want it to turn off routing.


My app is not made to provide routing information, nor do I want to set it as an IOS routing app.


Any help would be appreciated


I am using xcode 6.




Considering a project for an app that scans barcodes and communicates with a database

TL;DR - I want to make an app that will scan a barcode, then send a query to an online database. Is this possible?


Backstory


I'm thinking of taking on a project for my father, who is organizing a yearly hiking tour on the island where we live. They're thinking of modernizing the process of checking which participants have started and which have finished. Up untill this year, they did this by giving everyone a card with a number on, which is read to a volunteer at a checkpoint, who then checks them off a physical list. The idea is to switch to a system with barcodes instead. How this is actually supposed to work is what my father was trying to figure out when he came to me.


The idea


There are plenty of smartphone apps that can read barcodes, but for this purpose it needs to be possible for multiple people with scanners to 'check off' people from the same checklist (database) simultaneously. Because of this, I was thinking of making an (iphone) app that uses open source barcode scanner code to read the barcodes and then an internetconnection (3G) to access and update a central database. The aim for this year is 1000 participants, so that would be a list with id's from 1-1000, names, and 'status'. Statusses would be 'not started', 'started', 'finished' and 'dropped out'. You'd scan a code, then press a button to have the app send a message to the database to update that specific numbers status.


Questions


Firstly, I'm thinking of an iphone app because we can have volunteers use their own phones, but is that reliable? Would we be better off shelling out for a couple of handheld-scanners and using a pc with internet instead of a smartphone? The upside of being able to use smartphones is that as long as you have 3G conection, you can use it anywhere on the fly.


Secondly, is this setup of 'barcode-->app-->internet--->database' doable? I haven't worked with iphone apps before (I have a windows pc so I'd have to install OSX on a virtualbox). Also, does something that does this maybe already exist?


Thirdly, I'm not experienced with making apps, is it possible to make this and distribute it to a handful of people without putting it on the app-store? Like maybe physically connect the phones to my laptop and put the app on there?


Thanks for taking the time to read this, I really appreciate it!




X:code Spacing error anywhere?

import UIKit


class ViewController: UIViewController {



@IBOutlet weak var QuestionLabel: UILabel!

@IBOutlet weak var Button1: UIButton!
@IBOutlet weak var Button2: UIButton!
@IBOutlet weak var Button3: UIButton!
@IBOutlet weak var Button4: UIButton!


var CorrectAnswer = String()

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.

RandomQuestions()
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}



func RandomQuestions(){

var RandomNumber = arc4random() % 4
RandomNumber += 1

switch(RandomNumber){
case 1:

QuestionLabel.text = "Who is the best soccer player in the world?"
Button1.setTitle("Messi", forState: UIControlState.Normal)
Button2.setTitle("Neymar", forState: UIControlState.Normal)
Button3.setTitle("Bale", forState: UIControlState.Normal)
Button4.setTitle("James", forState: UIControlState.Normal)
CorrectAnswer = "2"

break
case 2:
QuestionLabel.text = "How many goals is a hat trick?"
Button1.setTitle("2", forState: UIControlState.Normal)
Button2.setTitle("5", forState: UIControlState.Normal)
Button3.setTitle("3", forState: UIControlState.Normal)
Button4.setTitle("7", forState: UIControlState.Normal)
CorrectAnswer = "3"

break
case 3:
QuestionLabel.text = "What number is Neymar?"
Button1.setTitle("2", forState: UIControlState.Normal)
Button2.setTitle("5", forState: UIControlState.Normal)
Button3.setTitle("3", forState: UIControlState.Normal)
Button4.setTitle("11", forState: UIControlState.Normal)
CorrectAnswer = "4"
break

case 4:
QuestionLabel.text = "What number is messi?"
Button1.setTitle("2", forState: UIControlState.Normal)
Button2.setTitle("10", forState: UIControlState.Normal)
Button3.setTitle("3", forState: UIControlState.Normal)
Button4.setTitle("7", forState: UIControlState.Normal)
CorrectAnswer = "2"



break
default:

break
}

}

@IBAction func Button1Action(sender: AnyObject) {

if (CorrectAnswer == "1"){

NSLog("You Are Correct")
}
else{
NSLog("YOu Are Wrong")
}
}
@IBAction func Button2Action(sender: AnyObject) {
if (CorrectAnswer == "2"){

NSLog("You Are Correct")
}
else{
NSLog("YOu Are Wrong")
}
}
@IBAction func Button3Action(sender: AnyObject) {
if (CorrectAnswer == "3"){

NSLog("You Are Correct")
}
else{
NSLog("YOu Are Wrong")
}
}
@IBAction func Button4Action(sender: AnyObject) {
if (CorrectAnswer == "4"){

NSLog("You Are Correct")
}
else{
NSLog("You Are Correct")
}
}


Could anyone help me with this I'm need to coding and i need help with this. i have look for any extra brackets i put and i have seen none any help?




How to convert AVAsset to NSData or save it to file manager

I am trying to do that using AVAsset to record Audio file and then after first i store it on NSFileManager and after that by convert it to nsdata i Call API to store it.


I am successful to Create AVAsset recording file and play it using third party Class that is SCPlayer.


Now problem is that i don't know how to Use AVAsset file for save it in file manager and then after call API to sent it by converting it to NSData.


Is any way to convert AVAsset to NSData???


Please Help...




Acceptable to use UIScreen.mainScreen().bounds.size.height to programmatically position elements?

Is using UIScreen.mainScreen().bounds.size.height to position or size elements in my layout based on device size an acceptable thing to do? Or will this kind of thing have me hauled off to a infinite loop cubical farm for a thrashing?




My AudioPlayer is not working. can't understand this

My audioPlayer is not working. I can't seem to understand why. I am a newbie and don't have much experience with swift. When I run, I am getting the println("audioPlayer not created") message. FilePath, FilePathUrl and mp3 have been confirmed and valid.


import UIKit import AVFoundation


class PlaySoundsViewController: UIViewController {



var audioPlayer:AVAudioPlayer!

override func viewDidLoad() {
super.viewDidLoad()

// Do any additional setup after loading the view.
if let filePath = NSBundle.mainBundle().pathForResource("crankringtone", ofType: "mp3"){
var filePathUrl = NSURL.fileURLWithPath(filePath)

audioPlayer = AVAudioPlayer(contentsOfURL: filePathUrl, error: nil)
} else {
println("file path is empty")
}
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}

@IBAction func playSlowAudio(sender: UIButton) {
// here you can check if the player was successfully created
if var audioPlayer = audioPlayer {
// here you can check if your player is playing
if audioPlayer.playing {
//if playing lets pause it
audioPlayer.pause()
} else {
//if plaused lets play it
audioPlayer.play()
}

} else {
println("audioPlayer not created")
}
}



Error getting shared calendar invitations for entity types 3, Xcode 6.1.1. EKCalender, EKSource, EKEventstore and Objective C

I am developing calendar app. I am trying to save EKEvent using assigned EKCalender. But when I try to run following code it gives me error. Please help



-(BOOL)createEventWithTitle:(NSString *)paramTitle startDate:(NSDate *)paramStartDate endDate:(NSDate *)paramEndDate inCalendar:(EKCalendar *)paramCalendar inEventStore:(EKEventStore *)paramStore notes:(NSString *)paramNotes
{
BOOL result = NO;

//paramCalendar = [self.eventStoreiReportShifts defaultCalendarForNewEvents];
if (self.eventsAccessGranted) {
NSArray *caledars = [self.eventStore calendarsForEntityType:EKEntityTypeEvent];
self.selectedCalendarEventKitIdentifier = [[NSUserDefaults standardUserDefaults] objectForKey:@"eventkit_cal_identifiers_string"];
for(EKCalendar *aCal in caledars){
if([aCal.calendarIdentifier isEqualToString:self.selectedCalendarEventKitIdentifier]){
paramCalendar = [self.eventStore calendarWithIdentifier:[[NSUserDefaults standardUserDefaults] objectForKey:@"eventkit_cal_identifiers_string"]];
}
}
for (EKSource *source in self.eventStore.sources) {
if (source.sourceType == EKSourceTypeCalDAV) {
paramCalendar.source = source;
break;
} else if(source.sourceType == EKSourceTypeLocal){
paramCalendar.source = source;
break;
}
}

}else{
return NO;
}

/* If a calendar does not allow modification of its contents
then we can not insert an event into it */
if (paramCalendar.allowsContentModifications == NO) {
NSLog (@ "\n\n The selected calendar does not allow modifications.");
return NO;
}
/* Create an event */

EKEvent * event = [EKEvent eventWithEventStore:paramStore];

event.calendar = paramCalendar;
/* Set the properties of the event such as its title,
start date / time, end date / time, etc. */
event.title = paramTitle;
event.notes = paramNotes;
event.startDate = paramStartDate;
event.endDate = paramEndDate;
/* Finally, save the event into the calendar */
NSError * saveError = nil;
result = [paramStore saveEvent:event
span:EKSpanThisEvent
error:&saveError];
if (result == NO) {
NSLog (@ "\n\n An error occurred = %@", saveError);
}
return result;
}


above code gives following error



CalendarCalculations[1668:45103]
Error getting shared calendar invitations for entity types 3 from
daemon: Error Domain=EKCADErrorDomain Code=1013
"The operation couldn’t be completed. (EKCADErrorDomain error 1013.)"


how can I get rid of it please?




Space in the content of UITableView

Today I faced a weir bug in UITableView. I have a UIViewController containing a UITableView. I also have a root viewcontroller, which will add the aforementioned UIViewController as a child. Now when loaded, it shows a space between cells and the top border. How can I fix that? enter image description here


enter image description here




Javascript url parameters with html5 video tag not working on iphone/ipad

I am having problem playing videos on iphone/ipad. I have multiple videos on a single page called "VideoPlayer.html" with the following script.





<script>
window.onload = function() {
var videoPlayer = document.getElementById("videoPlayer");
var videoId = queryObj()["V"];

switch(videoId)
{
case "MainMovie":
videoPlayer.src="../Videos/jude.mp4";
break;
case "Video2":
videoPlayer.src="../Videos/Puma_Slidshow.mp4";
break;
}
}

function queryObj() {
var result = {}, keyValuePairs = location.search.slice(1).split('&');

keyValuePairs.forEach(function(keyValuePair) {
keyValuePair = keyValuePair.split('=');
result[keyValuePair[0]] = keyValuePair[1] || '';
});

return result;
}

</script>



<div id="container">
<video id="videoPlayer" autoplay preload="metadata" controls></video>
</div>



Then i got a page called "Main.html" where i am linking these videos from Videoplayer.html with the following code.





<script>
window.onload = function() {
var videos = document.querySelectorAll(".link");
for (var i = 0; i < videos.length; i++) {
videos[i].addEventListener('click', clickHandler, false);
};
}

function clickHandler(el) {
window.open("VideoPlayer.html?V=" + el.target.id, "_self" );
}
</script>



<div id="menubar1">

<a id="MainMovie" class="link">Play Movie</a>
<a id="Video2" class="link">Scene Selection</a>
<a href="#">Special Features</a>

</div>



It all works fine on desktop when I click the "Play Movie" the url opens up with VideoPlayer.html?V=MainMovie and plays the video in a new window. which is exactly what i want but i need this code to work on iphone/ipad as well. I am really new to JavaScript and HTML. All these videos and HTML files will be used offline.


Thanks




Subscription duration logic

I just started work for a client on some of his iOS apps, he currently has a 6 month subscription and wants me to make it a 1 month. Even though you have to pick a duration on itunesconnect for the in app purchase, do you still have to implement the code for the duration? This is a learning project for me, new to working with in app purchases




Swift : String characters (marks) are not counted correctlly

Characters as (é) or in arabic (دٌ) are counted as one in a string, how do I make it recognise the mark as a character? It should be like (د) is a character and (ٌ) is another character. I don't want to use NSString because I'm using (startIndex) which is not supported in NSString as far as I know.


Thank you




How can I set a UITableView's cell text to database cell's content in Swift?

I am creating an iOS Pokémon database application using Swift, for my A2 computing coursework. Before this project, I have not used Swift, so I am teaching myself using relevant examples which I can hopefully copy and paste from.


I am using Xcode 6.1.1 and the SQLite.swift library from Stephen Celis.


One such test is producing a UITableView which can read from my pre-existing, pre-populated database.


I've managed to get the UITableView to create all the cells - and set the detailTextLabel to the indexPath (plus 1, so it starts at 1 and ends at 721 instead of starting at 0 and ending at 720). So I have 721 cells in the table just fine.


However, I can't seem to get the textLabel for each cell to display the correct data. Instead, it displays "SQLite.Expression" for each cell.


Above the ViewController class in the ViewController.swift file, I have



let db = Database("/Users/rhysmorgan/Documents/Coding/DatabaseLoadTest/Pokémon Database.sqlite", readonly: true)
let pokemonTable = db["Pokémon"]
let name = Expression<String>("PokéName")
let gen = Expression<Int>("Generation")


and in the main tableView function, I have



func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {

let cellIdentifier = "Cell"
let rowno: Int = indexPath.row + 1
let formatter = NSNumberFormatter(); formatter.minimumIntegerDigits = 3
let formattedrowno = formatter.stringFromNumber(rowno)
let pokemonname = pokemonTable[name]


let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath) as UITableViewCell

cell.textLabel?.text = "\(pokemonname)"
cell.detailTextLabel?.text = "\(formattedrowno!)"

return cell
}


Is anybody able to help me? With thanks in advance!




iPhone UITableView starts with offset in ios8, possibly due to tableViewFooter

My UITableView is starting with empty space between the top edge and the first section. Image here.


This problem occurs on iPhone but not on iPad. The table view has one section with a section header (a custom view set via tableView viewForHeaderInSection) and a UIActivityIndicator as the tableFooterView. The offset disappears if I remove the tableFooterView, so I guess it is related to that. But, I need a solution that keeps the footer, and I'm curious why it's happening in the first place.


Any thoughts? Thanks!




Xcode error when running on device: "Could not allocate a resource"

I'm getting the error "Could not allocate a resource" when I try to run on any of my devices. I've seen this as a possible fix:



sudo rm -rf /var/db/lockdown/


I've tried that and restarted my machine a handful of times, but no luck. I also tried changing USB ports. I've reinstalled Xcode as well after uninstalling with AppCleaner.


In addition to the error, whenever I connect a device it asks me "Trust This Computer?"


This is occurring on an iPhone 5 and iPhone 6+ with lightning, as well as an iPad 3 with the old style connector.




Itools and Iphone Configurtion Utilty Stopped Working

I updated my ipad to the latest version IOS 8.1.3 and also my itunes to the latest version - suddenly after that "itools" and "iphone configuration utility" stopped working.


I tried to reinstall itunes and restart the mobile support service without any success. without itools and phone configuration utility i can't capture logs on my ipad.



  1. what can i do to fix this issue ??

  2. is there another tool where i can capture logs and crash logs without using my pc (Windows 7 64 Bit)?


Thanks




iOS: How to check what the button background image is?

I am trying the following method ,but it isn't work. Is there a way I can check what my current background image is for my UIButton and compare it?



UIImage *buttonCheckImage = checkButton.currentBackgroundImage;
UIImage *checkImage = [UIImage imageNamed:@"checkBox.png"];

if (buttonCheckImage == checkImage) {

}



How to pause and resume timer in swift

I'm have never used NStimer in swift before.


How to pause NStimer and resume it ( or the same stuff ) when I want. Please tell me necessary steps to do it. Thank you.




Swift - UITableView won't add data

I have a UITableView and when I add data, it will only allow me to add one row in the UITableview even though I return goals.count for the amount of rows.


This is what I have.



@IBAction func myAddGoal(sender: AnyObject) {
let ac = UIAlertController(title: "Enter a Goal", message: "It can be anything you want!", preferredStyle: .Alert)
ac.addTextFieldWithConfigurationHandler(nil)
let submit = UIAlertAction(title: "Submit", style: .Default) { [unowned self, ac] (action: UIAlertAction!) in
let goal = ac.textFields![0] as UITextField
self.submitGoal(goal.text)
}
ac.addAction(submit)
ac.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Destructive, handler: nil))
presentViewController(ac, animated: true, completion: nil)
}



func submitGoal(goal: String){
if goal == "" {
println("textfield is empty")
} else {
goals.insert(goal, atIndex: 0)
let indexPath = NSIndexPath(forRow: 0, inSection: 0)
myTableView.insertRowsAtIndexPaths([indexPath], withRowAnimation: .Automatic)
myTableView.reloadData()
println(goals)
}
}


I am able to add only ONE goal and it will animate into the UITableView. If I want to add another goal, it will not let me. The app crashes when I hit submit for a second goal entry.



func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 1
}


func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return goals.count
}

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as UITableViewCell

let object = goals[indexPath.row]
cell.textLabel!.text = object

mySwitch.on = false
mySwitch.tag = indexPath.row as Int
mySwitch.addTarget(self, action: "UISwitchUpdated", forControlEvents: UIControlEvents.TouchUpInside)
cell.selectionStyle = .None
cell.accessoryView = mySwitch
return cell

}



AVCaptureDevice isTorchActive always return NO

Following code doesn't work correctly:



AVCaptureDevice *flashLight = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
if ([flashLight isTorchAvailable] && [flashLight isTorchModeSupported:AVCaptureTorchModeOn])
{
BOOL success = [flashLight lockForConfiguration:nil];
if (success)
{
if ([flashLight isTorchActive])
{
//TURN OFF
[flashLight setTorchMode:AVCaptureTorchModeOff];
}
else
{
//TURN ON
[flashLight setTorchMode:AVCaptureTorchModeOn];
}
[flashLight unlockForConfiguration];
}
}


[flashLight isTorchActive] returns NO even if it's active.


UPD: Replacing ([flashLigh isTorchActive]) with if (flashLight.torchMode == AVCaptureTorchModeOn) helped. But if torch was previously activated from Control Center, i get AVCaptureTorchModeOff, when running this code first time.




I have an Unwind segue that does work programmatically but works tied to a button

I have a app project I am working on. I created an unwind segue in my main view as



@IBAction func unwindToHomeScreen(segue:UIStoryboardSegue) {
}


It works from another view from the cancel button


enter image description here


however in the same view when I call the segue



self.performSegueWithIdentifier("unwindToHomeScreen", sender: self)


The app crashes with



Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<TravelSave.AddVacationTableViewController: 0x7907f380>) has no segue with identifier 'unwindToHomeScreen''


Any suggestions?




What steps to follow when to publish an iOS app?

As being first app, When is right time to buy APPLE's Student Program for Developer's Account so as to put app in iphone for debugging and testing purposes? or is there any way to put apps in iphone without having dev acc. ? AND can we use same dev accounts on two MACs because app being developed on two different macs?




Disabling UIImage from stretching

I have a problem with add a UIImage view to a project !When I want to add an UIImageView it stretches the whole screen with no edges to resize, I even tried to adjust that in the Pin window but that also didn't work as all options were disabled ! Why is that ? Is it a glitch in Xcode ?




Create a ViewController that shows on First Launch Only

SO I am creating an iOS app that involves allowing the user to be able to receive push notifications. I already have the following code in my appDelegate didFinishLaunchingWithOptions.



if ([application respondsToSelector:@selector(isRegisteredForRemoteNotifications)])
{
// iOS 8 Notifications
[application registerUserNotificationSettings: [UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
[application registerForRemoteNotifications];


}


So far so good, however, i would like to create an initial view controller that only shows on first launch, it will hopefully explain and justify to the user why it need the ability to send the user push notifications, they can then press continue and it will ask them by executing the code above. This would hopefully only happen on the first launch. Any suggestions?


Thanks




Parse Event Title from Event Kit

So, I would like to read in my array of events from a calendar I am subscribed to. The events all have a similar format, for example with two modules, 'Meaning of Life' and 'Running long distances':


Talk: Meaning of Life


Talk: Running long distances


Talk: Meaning of Life


Talk: Meaning of Life


Talk: Running long distances


I would like to be able to use something like



[[event.title componentsSeparatedByString:@"Talk: "] objectAtIndex:i];


So that in my table view I can have a 'Meaning of life' cell and a 'Running long distances' one. The idea would then be to select one and you could see all the 'Talks' for that module. There are other categories too like 'Workshops' and 'Practicals'.


Currently my code to just display all the events is as follows (ignoring the getting events of selected calendar and producing an array titled arrEvents)



-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"TableIDCell"];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"TableIDCell"];
}

// Get each single event.
EKEvent *event = [self.arrEvents objectAtIndex:indexPath.row];

// Set its title to the cell's text label.
cell.textLabel.text = event.title;

// Get the event start date as a string value.
NSString *startDateString = [self.appDelegate.eventManager getStringFromDate:event.startDate];

// Get the event end date as a string value.
NSString *endDateString = [self.appDelegate.eventManager getStringFromDate:event.endDate];

// Add the start and end date strings to the detail text label.
cell.detailTextLabel.text = [NSString stringWithFormat:@"%@ - %@", startDateString, endDateString];

if (indexPath.row%2 == 0) {
UIColor *altCellColor = [UIColor colorWithWhite:0.7 alpha:0.1];
cell.backgroundColor = altCellColor;
}

return cell;
}


Thanks for taking the time to read :)




all contact numbers not coming from the address book

I faced one problem from the address book,i saved two phone numbers from my contacts one as home other one as office,i am getting only one number in ,application contact list.if i want to get the two numbers what i want to do.




Encryption/Decryption of a file using AES256 in xcode

I want to encrypt/decrypt text using signature key. Can anybody help me to do generate signature key and encrypt/decrypt text in ios


Please help


Thanks in advance




vendredi 30 janvier 2015

bug compiling alamofire - unknown option character `X' in: -Xlinker

Trying to add alamofire to a project using cocoapods. Xcode version: Version 6.1.1 (6A2008a)


Podfile:



source 'http://ift.tt/1czpBWo'
platform :ios, '8.0'

pod 'OAuth.io'
pod 'Alamofire', '~> 1.1'


Here's the error:



Libtool /Users/tony/Library/Developer/Xcode/DerivedData/Candytone-aynufizixrzmtwgatrvrjynlonxv/Build/Products/Debug-iphonesimulator/libPods-Alamofire.a normal x86_64
cd /Users/tony/src/candytone-ios/Candytone/Pods
export IPHONEOS_DEPLOYMENT_TARGET=8.1
export PATH="/Applications/http://ift.tt/1eHqHUg"
/Applications/http://ift.tt/1aauSQY -static -arch_only x86_64 -syslibroot /Applications/http://ift.tt/1wvrkVu -L/Users/tony/Library/Developer/Xcode/DerivedData/Candytone-aynufizixrzmtwgatrvrjynlonxv/Build/Products/Debug-iphonesimulator -filelist /Users/tony/Library/Developer/Xcode/DerivedData/Candytone-aynufizixrzmtwgatrvrjynlonxv/Build/Intermediates/Pods.build/Debug-iphonesimulator/Pods-Alamofire.build/Objects-normal/x86_64/Pods-Alamofire.LinkFileList -L/Applications/http://ift.tt/107CuVI -Xlinker -add_ast_path -Xlinker /Users/tony/Library/Developer/Xcode/DerivedData/Candytone-aynufizixrzmtwgatrvrjynlonxv/Build/Intermediates/Pods.build/Debug-iphonesimulator/Pods-Alamofire.build/Objects-normal/x86_64/Pods_Alamofire.swiftmodule -framework Foundation -o /Users/tony/Library/Developer/Xcode/DerivedData/Candytone-aynufizixrzmtwgatrvrjynlonxv/Build/Products/Debug-iphonesimulator/libPods-Alamofire.a

error: /Applications/http://ift.tt/1aauSQY: unknown option character `X' in: -Xlinker
Usage: /Applications/http://ift.tt/1aauSQY -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Applications/http://ift.tt/1aauSQY -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]



subview/alertview not showing after uitableview scroll

The problem is that I have a button in customtableviewcell which is in the top of the uitableview. When I press the button alertview/subview is shown. But if I scroll down and back in tableview the button wont show anything. I guess that the alertview somehow goes under the other cells.


Here is the code that happens when user press the button:



- (IBAction)Button:(id)sender {
NSLog(@"lol");

if([_Something isEqual: @"1" ]){

RNBlurModalView *modal = [[RNBlurModalView alloc] initWithParentView:self title:@"" message:@""];
[modal show];
}


Also nslog logs "lol" when the button is pressed but the alertview is not showing up.


Help is more than appreciated!




How to combine two SKTextures into one

I am trying to create a background fora game and have two background images. I can use two different SKSpriteNode(), SKTexture, SKAction.sequence..etc and some math to stitch them together but it comes out kind of choppy and also I cant seem to get the math just right. They are supposed to be able to be combined to make a long changing background but it always offsets.


Can someone tell me how to combine both textures into one so I dont have to break my head with the math. Or if someone spots some errors in my math can you please point them out?



override func didMoveToView(view: SKView) {
/* Setup your scene here */

var bgTexture = SKTexture(imageNamed: "bg_2_midground_1.png")
var bgTexture2 = SKTexture(imageNamed: "bg_2_midground_2.png")

var totalBG = bgTexture.size().width + bgTexture2.size().width

var moveBG1 = SKAction.moveByX(-bgTexture.size().width, y: 0, duration: 12)
//shift bg back to be able to repeat itself
var replaceBG1 = SKAction.moveByX(bgTexture.size().width, y: 0, duration: 0.0) //move immediately back to replace self
var moveBG1Forever = SKAction.repeatActionForever(SKAction.sequence([moveBG1,replaceBG1]))

var moveBG2 = SKAction.moveByX(-bgTexture2.size().width, y: 0, duration: 12)
//shift bg back to be able to repeat itself
var replaceBG2 = SKAction.moveByX(bgTexture2.size().width, y: 0, duration: 0.0) //move immediately back to replace self
var moveBG2Forever = SKAction.repeatActionForever(SKAction.sequence([moveBG2,replaceBG2]))

for var i:CGFloat = 0; i<2; i++ {
var bg = SKSpriteNode(texture: bgTexture)
var bg2 = SKSpriteNode(texture: bgTexture2)

bg.position = CGPointMake(bgTexture.size().width/2.0 + bgTexture.size().width * i + bgTexture2.size().width * i, CGRectGetMidY(self.frame))
bg2.position = CGPointMake(bgTexture.size().width/2.0 + bgTexture2.size().width + bgTexture2.size().width * 2 * i, CGRectGetMidY(self.frame))

bg.runAction(moveBG1Forever)
bg2.runAction(moveBG2Forever)

self.addChild(bg)
self.addChild(bg2)

println(bg.position)
println(bgTexture.size().width)

println(bg2.position)
println(bgTexture2.size().width)
}


}




Importing .swift file into Objective-C file results in Missing Context For Method Declaration Error

I am refactoring a few Objective-C ViewControllers and am trying to import a new Controller.swift file into a ViewController.m. However when I do that and run I get "Missing Context For Method Declaration" error for every method in the ViewController.m file.


this causes the error:



#import "ViewController.h"
#import "ContactsController.swift"


When I run without the .swift file import everything works fine. Also I have successfully imported this .swift file into other controllers in the above manner.


However when I change the order of the imports as such it works:



#import "ContactsController.swift"
#import "ViewController.h"


I have tried to research this, but to no avail. What are the possible reasons that the import could work in one order and not the other?




View local development server on USB-connected iOS device

I have my OS X development laptop hooked up to the net via an iPhone 5 connected with USB (Personal Hotspot). With a web server running locally for my development work, can I load pages from this server on my iPhone and then inspect them with Safari's Web Inspector? I have tried 127.0.0.1 and my connected IP public address but no success.




CSLinearLayoutView for iOS app not working as expected

I'm trying to use CSLinearLayoutView in an iPhone app, and I'm following the demo code to try and apply it. However, when I attempt to create a linear Layout of buttons (very basic just to test it) they all stack on top of each other instead of laying out how they should. what am I doing wrong? screenshot



- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
// create the linear layout view
CSLinearLayoutView *linearLayoutView = [[CSLinearLayoutView alloc] initWithFrame:self.view.bounds];
linearLayoutView.orientation = CSLinearLayoutViewOrientationVertical;
[self.view addSubview:linearLayoutView];

UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 20)];
label1.text = @"label1";

// create a layout item for the view you want to display
CSLinearLayoutItem *item = [CSLinearLayoutItem layoutItemForView:label1];
item.padding = CSLinearLayoutMakePadding(5.0, 10.0, 5.0, 10.0);
item.horizontalAlignment = CSLinearLayoutItemHorizontalAlignmentCenter;
item.fillMode = CSLinearLayoutItemFillModeNormal;

// add the layout item to the linear layout view
[linearLayoutView addItem:item];


UILabel *label2 = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 20, 20)];
label1.text = @"label2";

// create a layout item for the view you want to display
CSLinearLayoutItem *item2 = [CSLinearLayoutItem layoutItemForView:label2];
item.padding = CSLinearLayoutMakePadding(5.0, 10.0, 5.0, 10.0);
item.horizontalAlignment = CSLinearLayoutItemHorizontalAlignmentCenter;
item.fillMode = CSLinearLayoutItemFillModeNormal;




UILabel *label3 = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 20, 20)];
label1.text = @"label3";

// create a layout item for the view you want to display
CSLinearLayoutItem *item3 = [CSLinearLayoutItem layoutItemForView:label3];
item.padding = CSLinearLayoutMakePadding(5.0, 10.0, 5.0, 10.0);
item.horizontalAlignment = CSLinearLayoutItemHorizontalAlignmentCenter;
item.fillMode = CSLinearLayoutItemFillModeNormal;


UILabel *label4 = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 20, 20)];
label1.text = @"label4";


// create a layout item for the view you want to display
CSLinearLayoutItem *item4 = [CSLinearLayoutItem layoutItemForView:label4];
item.padding = CSLinearLayoutMakePadding(5.0, 10.0, 5.0, 10.0);
item.horizontalAlignment = CSLinearLayoutItemHorizontalAlignmentCenter;
item.fillMode = CSLinearLayoutItemFillModeNormal;

CSLinearLayoutView *linearLayoutView2 = [[CSLinearLayoutView alloc] initWithFrame:self.view.bounds];
linearLayoutView.orientation = CSLinearLayoutViewOrientationHorizontal;

[linearLayoutView2 addItem:item2];
[linearLayoutView2 addItem:item3];
[linearLayoutView2 addItem:item4];




// create a layout item for the view you want to display
CSLinearLayoutItem *horizontal = [CSLinearLayoutItem layoutItemForView:linearLayoutView2];
item.padding = CSLinearLayoutMakePadding(5.0, 10.0, 5.0, 10.0);
item.horizontalAlignment = CSLinearLayoutItemHorizontalAlignmentCenter;
item.fillMode = CSLinearLayoutItemFillModeNormal;

[linearLayoutView addItem:horizontal];


}



how to change the position of image inside cell of uitableview

I have added an image to the cell of a uitableview, but when I tried to change the position of the image nothing happened.


This is what my tableview function looks like:



override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as UITableViewCell

let article = articles[indexPath.row] as Article

cell.textLabel!.text = article.title

cell.imageView?.image = article.image
let rect = CGRect(x: 0, y: 0, width: 100, height: 100)
cell.imageView?.frame = rect

return cell
}


As you can see the image shows up but the position stays the same:



Any ideas why this happens?




iPhone landscape rotation crash UICollectionView

So my UIWindow base controller is a UITabBarController with 3 UINavigationControllers which 2 (of the 3) contain a UITableViewController and one contains a UICollectionViewController. If the user attempts to rotate their iPhone (I don't have this problem on iPad for some reason) on any of the other 2 views (any other view but the UINavigationController one that contains the UICollectionViewController) the app will crash:


Assertion failure in -[UICollectionView _endItemAnimations], /SourceCache/UIKit_Sim/UIKit-3318.16.14/UICollectionView.m:3917


Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of items in section 1. The number of items contained in an existing section after the update (2) must be equal to the number of items contained in that section before the update (2), plus or minus the number of items inserted or deleted from that section (1 inserted, 0 deleted) and plus or minus the number of items moved into or out of that section (0 moved in, 0 moved out).


But if the user rotates while that view (the UINavigationController one that contains the UICollectionViewController) is currently open or has been opened at least once, it doesn't crash and functions as normal. Is this a bug in iOS? Is there a way I can fix this?




JSON url response null

I write an application for iphone in objective-c and wanna get data from json. but I get null from url, but url is correct and when I pass url to browser I see the json data. this is my IBAction method:



- (IBAction)checkMobileNumber:(id)sender {
NSString *prefix = self.prefixTextField.text;
NSString *number = self.numberTextField.text;
NSString *url =[NSString stringWithFormat:@"http://ift.tt/15Q9nsW", prefix, number];
NSURL *jsonURL = [NSURL URLWithString:url];
@try {
[[[NSURLSession sharedSession] dataTaskWithURL:jsonURL completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
NSString* rawJSON = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSError *err;
self.checkMobile = [[CheckMobileProviderModel alloc] initWithString:rawJSON error:nil];
if (err) {
NSLog(@"Unable to initialize PublicPhotosModel, %@", err.localizedDescription);
}
dispatch_async(dispatch_get_main_queue(), ^{
NSLog(@"%@", self.checkMobile.response);
//NSLog(@"%@", self.checkMobile.fault[@"faultString"]);
});
}] resume];
}
@catch (NSException * e) {
NSLog(@"Exception: %@", e);
}
}


what is wrong here? any help?




iOS Lock Screen Method

I want to have an app whose sole purpose is to lock the screen. I want to mimic the function of Settings>General>Accessibility>Assistive Touch>Device>Lock Screen.


I am new to iOS development. I have an app in Xcode with one button. I am trying to find the lock screen method.


Thanks.




How to Nsmutabledictionary values add to Nsmutablearray

My Json format like[{"id":1,"name":"xyz"}{"id":1,"name":"xyz"}{"id":1,"name":"xyz"}] so here i want put new dictionary value .so my new json format [{"id":1,"name":"xyz","job":"gg"}{"id":1,"name":"xyz","job":"gg"}{"id":1,"name":"xyz","job":"gg"}] please help me.




Animations using UIDynamics

I am new bee to UIDynamics how to do this this type of animations using UIDynamics




how to fetch data from server through afnetworking in phone sdk

I am creating iOS app and trying to fetch data from server through afnetworking code is following



NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration];

NSURL *URL = [NSURL URLWithString:@"http://XXXXXX/DisplayDetail.php"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL];
NSURLSessionDataTask *dataTask = [manager dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
if (error) {
NSLog(@"Error: %@", error);
} else {
NSLog(@"%@ %@", response, responseObject);
}
}];
[dataTask resume];


But I am getting following error



Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: text/html" UserInfo=0x7f9f3943aee0 {com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x7f9f3954e0b0> { URL: http://ift.tt/1uDW4C6 } { status code: 200, headers {
Connection = "Keep-Alive";
"Content-Type" = "text/html";
Date = "Thu, 29 Jan 2015 07:30:36 GMT";
"Keep-Alive" = "timeout=5";
Server = "Apache/2.4.10 (Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4 mod_fcgid/2.3.10-dev";
"Transfer-Encoding" = Identity;
"X-Powered-By" = "PHP/5.4.34";}
},
NSErrorFailingURLKey=http://ift.tt/1uDW4C6, com.alamofire.serialization.response.error.data=<5b7b2275 7365725f 6964223a 22313039 222c2275 7365725f 656d6169 6c223a22 616e7572 61674067


............


So please help me how to resolve it.




Ios Can i get Upload progress from Graph api Facebook?

In my app i need to upload a video to the user's facebook wall. I use this code and it works:



[FBRequestConnection startWithGraphPath:@"me/videos"
parameters:params
HTTPMethod:@"POST"
completionHandler:^(FBRequestConnection *connection,
id result,
NSError *error)
{
if (error)
{
//showing an alert for failure

}
else
{
//showing an alert for success



}

}];


I wanna add a progress bar during the upload time... but i can't find anything that works...I have read the documentation also, but i can't find anything... There is a way manage a progress bar for @"me/videos" ?




Can't change screen brightness in applicationWillTerminate

My app gives the user the possibility to change the screen brightness and after the app is terminated i want to restore the initial brightness whenn the app was started.


I use applicationWillTerminate as my app opts out of multitasking and thus is terminated instead of moved to background when the home button is pressed.


The issue: [UIScreen mainScreen].brightness = self.brightnessAfterLaunch is completely ignored when called in applicationWillTerminate and the system brightness is at the previously set brightness within the app after termination. (NOT the brightness before the app was started!)


Why is this igrnored or is there any other way to restore the previous system brightness?




Best way for hosting videos to embed them in an (iOS) app [on hold]

I read different posts on this with with no luck.


I am developing an Iphone app that will allow users to upload a max 30 seconds video. Then the users will be able to watch those videos after.


I already have some problems streaming 1 video sometimes :) I have a basic web hosting with www.ipage.com ...but for 1 video a problem ? that sucks...


What If 1000 users are streaming at the same time ?


What is the best solution to do this and get approved by Apple ?


Remember Users Upload/Stream, I don't upload the videos myself.


I heard about Embedded solutions !! what s the best ?


Basically I am asking for the best solution to host my videos outside my own web server.


Thank you




PDF doesn't open on a very specific iPhone device

This is a very strange problem. Here goes:


I have an iPhone app. There's a button, when you click the button, it downloads a PDF and displays it.


This works on all iPhones and iPads I tried it with. iOS 7.1.1, 8.1.2, 8.1.3 all works.


Except for 1 iPhone. This iPhone is running iOS 8.1.3. When I click the button, nothing happens. no error messages, nothing.


It's an iPhone 5c, bought in Hong Kong. All the other devices I tried was bought in Europe. As far as I can tell, this appears to be the only difference.


We tried a hard reset, we tried deleting and reinstalling the app. We tried installing the app via testflight and enterprise distribution. All to no avail.


Any ideas on what else I can try?




isRegisteredForRemoteNotifications always returns no

I got the pop up, i have accepted, i see it in the notifications and it is turned on but this code always returns no and i cant seem to find out why



UIApplication *application = [UIApplication sharedApplication];

BOOL enabled;

// Try to use the newer isRegisteredForRemoteNotifications otherwise use the enabledRemoteNotificationTypes.
if ([application respondsToSelector:@selector(isRegisteredForRemoteNotifications)])
{

enabled = [application isRegisteredForRemoteNotifications];
}
else
{
UIRemoteNotificationType types = [application enabledRemoteNotificationTypes];
enabled = types & UIRemoteNotificationTypeAlert;

}
if (enabled){
NSLog(@"is registered");
}else{
NSLog(@"is not registered");
}



restore UIImageView Image in IBAction

I am adding a image in IBAction, i want to restore the old image back once the button is tapped.


its is not UIButton image, it is UIImage view.



- (IBAction)findMe:(id)sender
{
[self.imageView setImage:[UIImage imageNamed:@"image2"]];
}


I want to restore@"image1". immediate once button is tapped




iPhone can not play video from my web page (server)

I am streaming video using NanoHTTPD from android device. Every device can play the video file in web page or using external media player except iPhone. Even Mac desktop can play the file too. I manually pushed the video file into iPhone and it's playable. So there is no issue about video format. When i click on the link iPhone open a video player (inside web page) and nothing happen.


Response


enter image description here




iOS Face detection and working out if they're facing left or right?

I'm using CIDetector to find faces in images on the iPhone. It's working and I'm able to find the eye and mouth locations and the face angle, no problems.


I'm wondering if there is a way to work out if the person is looking left or right from the positions of the features? Or some other info in the CIFaceFeature data?


Does anyone know a formula for working this out, or is there a different API you'd suggest to do this? I'd like to do it on both moving and still images.


Any advice would be awesome.




UITextView with DatePicker

I have an UITextView and one of my methods requires to change the UITextView inputView to an UIDatePicker, so the user can select a date for a reminder.


Here is the code I used



self.datePicker = [[UIDatePicker alloc] init];
self.noteTextView.inputView = self.datePicker;
[self.noteTextView becomeFirstResponder];


everything works perfectly, but I can't manage to switch back from datePicker to the default keyboard. What I have tried is the following code:



self.noteTextView.inputView = UIKeyboardTypeDefault;



apple-touch-icon and apple-itunes-app tag not working

i added both to my website but both dose't work below you can find what i add exactly



<meta name="apple-itunes-app" content="app-id=(the app ID)">


and also this :



<link rel="apple-touch-icon" href="/images/touch-icon-iphone.png">
<link rel="apple-touch-icon" sizes="76x76" href="/images/touch-icon-ipad.png">
<link rel="apple-touch-icon" sizes="120x120" href="/mritems/assets/images/touch-icon-iphone-retina.png">
<link rel="apple-touch-icon" sizes="152x152" href="/images/touch-icon-ipad-retina.png">


both dos't work shall i add more thing to it ? anything wrong with this ?


thanks




confusing about the height of cell, UITableViewCell,iOS

I am loading a custom cell from xib in which the height of cell is 64 and then using heightForRowAtIndexPath to change the height of cell like following :



- (void)viewDidLoad
{
[super viewDidLoad];
CGRect frame = CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height);
UITableView *tableView = [[UITableView alloc] initWithFrame:frame style:UITableViewStylePlain];
tableView.delegate = self;
tableView.dataSource = self;
UINib *cellNIB = [UINib nibWithNibName:NSStringFromClass([TableCell class]) bundle:nil];

[tableView registerNib:cellNIB forCellReuseIdentifier:NSLocalizedString(@"TableCell", nil)];

[self.view addSubview:tableView];
}

(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 400 ;
}


At cellForRowAtIndex, I am printing out the height of cell



- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
TableCell *cell = [tableView dequeueReusableCellWithIdentifier:NSLocalizedString(@"TableCell", nil)];
NSLog(@"height at:%ld is %@",(long)indexPath.item,NSStringFromCGRect(cell.frame));
[cell setGradient];

return cell;
}


It is interesting that the console gives me the height of cell of 64 ( which comes from the xib )


Is it supposed to be 400 ?


Any ideas why I am getting 64 instead of 400. Any comments are welcomed here. Thanks




iPhone configuration utility failed to locate 'Apple Mobile Device Support'

I am currently using the Marmalade SDK on my Windows machine to build an app. I am trying to test the app on an iPhone, and downloaded the iPhone Configuration Utility in order to do so. However, whenever I launch it, I get the following error:


iPhone configuration utility failed to locate 'Apple Mobile Device Support'. Please Reinstall the iPhone Configuration Utility. You can download the iPhone configuration Utility from http:://www.apple.com/support/iphone/enterprise.


However, even when I re-install it, I keep getting the same error. Any help would be greatly appreciated!




iOS 8.1.2 Remote Notification Issue When App Is In The Background

I am having issues with processing push notifications in the background on iOS 8.1.2, specifically on the iPhone.


So basically, when I send a push notification to my iPad (running iOS 8.1.2), the method application:didReceiveRemoteNotification:fetchCompletionHandler: always gets called whether my app is running in the foreground or suspended in the background. However on my iPhone (also running iOS 8.1.2) the method only gets called when my app is in the foreground.


Has anyone experienced this problem before, or maybe know the solution?


FYI, my app already has the remote-notifications background mode enabled and I have added content-available = 1 to the notification payload. I am also sending the push notifications on a production environment.




Adding a placeholder frame when choose a picture to crop

I would like to know how to add a custom placeholder frame so the user can crop an image. I have attached what I mean because im finding it hard to explain.


I also attached the default editing style when you set .allowsEditing = true


Im guessing I need to somehow override this and im hoping someone has experience with this issue


thanks for your help.


enter image description here


enter image description here




Media Query (for iPhone) Section Not Being Applied; Other Queries Working

currently working on a temp page for a restaurant as seen at: mattt.co/ok-rm/iddu. I've set up a number of @media breakpoints for large-to-small desktop screens as well as for mobile.


The queries seem to work fine, however, one specific query is not functioning properly, and that is the '.footer1 a, footer2 a' styles in the iPhone landscape view — query as follows:



@media only screen and (min-width : 320px) and (max-width: 736px) and (orientation: landscape)


As it stands, when viewed in landscape mode the site displays as follows on the iPhone: Image.


This is an error, as the scale of the footer text (phone no., e-mail, etc.) should be displayed as follows (seen through Chrome's iPhone emulator): Image.


I'm not sure why all other elements seem to be scaling correctly at their respective breakpoints, but the ".footer1 a", and ".footer2 a" styles are not appearing as intended specifically on the landscape view for the iPhone.


I've attached the relevant code below.



<meta name="viewport" content="width=device-width, initial-scale=1" />

.footer1 a, .footer2 a {
font-family: pitch;
display: block;
font-size: 30px;
line-height: 40px;
letter-spacing: 1px;
}

@media only screen and (min-width: 1400px) and (max-width: 1599px) and (orientation: landscape) {
.footer1 a, .footer2 a {
font-size: 25px;
line-height: 35px;
}
}


@media only screen and (min-width: 1201px) and (max-width: 1399px) and (orientation: landscape) {
.footer1 a, .footer2 a {
font-size: 20px;
line-height: 30px;
}
}

@media only screen and (min-width: 1025px) and (max-width: 1200px) and (orientation: landscape) {
.footer1 a, .footer2 a {
font-size: 20px;
line-height: 30px;
}
}

@media only screen and (max-width: 1024px) and (orientation: landscape) {
.footer1 a, .footer2 a {
font-size: 15px;
line-height: 20px;
}
}

@media only screen and (min-width : 569px) and (max-width: 1024px) and (orientation: portrait) {
.footer1 a, .footer2 a {
font-size: 28px;
line-height: 36px;
}
}

@media only screen and (min-device-width : 569px) and (max-device-width: 1024px) and (orientation: landscape) {
.footer1 a, .footer2 a {
font-size: 20px;
line-height: 30px;
}
}

@media only screen and (min-width : 320px) and (max-width: 736px) and (orientation: portrait) {
.footer1 a, .footer2 a {
font-size: 15px;
line-height: 20px;
}
}

@media only screen and (min-width : 320px) and (max-width: 736px) and (orientation: landscape) {
.footer1 a, .footer2 a {
font-size: 15px;
line-height: 20px;
}
}


If anyone could take a look that would be greatly appreciated! I can't figure out where I've gone wrong, even when using Safari's iPhone developer tool to inspect element, the listed style is turning up correctly.


Many Thanks!




HTML/css edit for iphone lockscreen

i combined a couple of themes for my iphone lockscreen, and i couldnt get the date to be aligned at the bottom right side of the screen. (I want it to be at the side of "days") I'm practically new at this so i'm sorry if the code is a bit messy :





function calculateTime() {

var Make_It_12_Hour = false;
var currentTime = new Date();
var hour = currentTime.getHours();
var minutes = currentTime.getMinutes();

if (Make_It_12_Hour) {
hour = hour % 12;
hour = (hour) ? hour : 12;
}

hour = hour.toString();
minutes = minutes.toString();

if (hour.length == 1) {
hour = "0" + hour;
}
if (minutes.length == 1) {
minutes = "0" + minutes;
}

var hour_left = parseInt(hour.charAt(0)).toString(2);
var hour_right = parseInt(hour.charAt(1)).toString(2);
var minutes_left = parseInt(minutes.charAt(0)).toString(2);
var minutes_right = parseInt(minutes.charAt(1)).toString(2);

hour_left = addZeroes(hour_left, 4);
hour_right = addZeroes(hour_right, 4);

minutes_left = addZeroes(minutes_left, 4);
minutes_right = addZeroes(minutes_right, 4);

hour_left = reverse(hour_left);
hour_right = reverse(hour_right);
minutes_left = reverse(minutes_left);
minutes_right = reverse(minutes_right);

guiOutput(hour_left, "1");
guiOutput(hour_right, "2");
guiOutput(minutes_left, "3");
guiOutput(minutes_right, "4");
}


function calculateDate() {

var months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
var currentTime = new Date();
var day1 = (currentTime.getDate() - 1).toString();
var day2 = currentTime.getDate().toString();
var day3 = (currentTime.getDate() + 1).toString();
var month = currentTime.getMonth();

if (day1.length == 1) {
day1 = "0" + day1;
}
if (day2.length == 1) {
day2 = "0" + day2;
}
if (day3.length == 1) {
day3 = "0" + day3;
}



var CIRCLE_FILLED = '<div class="c-f"></div>';
var CIRCLE_EMPTY = '<div class="c-e"></div>';

var currentTime = new Date();
var day = currentTime.getDate();
var dayBinary = day.toString(2);
dayBinary = addZeroes(dayBinary, 5);
guiOutput(dayBinary, "date");

var actualDay = currentTime.getDay();
console.log(actualDay);

clearClassAttributes(); /* We need to clear every "selected" class before we can set a new one */
document.getElementById(actualDay).setAttribute("class", "selected");
document.getElementById("date1-1").innerText = months[month - 1];
document.getElementById("date1-2").innerText = months[month];
document.getElementById("date1-3").innerText = months[month + 1];

document.getElementById("date2-1").innerText = day1;
document.getElementById("date2-2").innerText = day2;
document.getElementById("date2-3").innerText = day3;


}



function clearClassAttributes() {
for (var ic = 0; ic < 7; ic++) {
document.getElementById(ic).setAttribute("class", "");

}

}


function reverse(s) {
return s.split("").reverse().join("");
}


function addZeroes(input, maxAmount) {
while (input.length < maxAmount) {

input = "0" + input;
}

return input;
}



function guiOutput(time, id) {
var CIRCLE_FILLED = '<div class="c-f"></div>';
var CIRCLE_EMPTY = '<div class="c-e"></div>';
for (var i = 0; i < time.length; i++) {
var circle = (time.charAt(i) == 1) ? CIRCLE_FILLED : CIRCLE_EMPTY;
document.getElementById(id + "-" + (i + 1)).innerHTML = circle;
}

}



calculateTime();
calculateDate();
setInterval(calculateTime, 2000);
setInterval(calculateDate, 60000);



* {
padding: 0;
margin: 0;
}
#clock {
margin: auto;
padding: 40px 0 0 0;
width: 206px;
}
#date {
margin: auto;
padding: 10px 0 0 0;
width: 222px;
}
.row {
display: inline-block;
margin: 0 10px;
}
.c-e,
.c-f {
box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.4);
}
.c-f {
width: 20px;
height: 20px;
border-radius: 10px;
margin: 0 0 15px 0;
background-color: #E6FAE6;
}
.c-e {
width: 15px;
height: 15px;
border-radius: 20px;
margin: 0 0 15px 0;
border: 3px solid #838B8B;
opacity: 0.4
}
.date-line {
display: inline-block;
margin: 0 10px;
}
li {
font-family: 'GeoSansLight', sans-serif;
font-weight: 300;
}
ul {
list-style-type: none;
padding: 0 0 0 10px;
}
li {
font-size: 18px;
font-weight: bold;
margin: 0 0 4px 0;
text-transform: uppercase;
color: #6D6D6D;
}
li.selected {
color: #E4E4E4;
}
#day-container {
position: absolute;
bottom: 5px;
left: 1.5px
}
body {
background: url('bg.png') center center no-repeat;
background-size: 100%;
}
p.date {
color: rgba(255, 255, 255, 0.35);
-webkit-filter: blur(1px);
text-transform: uppercase;
}
p {
font-weight: 300;
color: white;
}
.selected {
color: rgba(255, 255, 255, 1) ! important;
-webkit-filter: none ! important;
#date-container {
position: absolute;
width: 150px;
margin: auto;
bottom: 5px;
right: 0px
}
.left,
.right {
display: inline-block;
}
.right {
border-left: 1px solid #fff;
margin: 0 0 0 10px;
padding: 0 0 0 10px;
}



<html>



<head>



<title>binary</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0">

</head>

<body>

<div id="clock">

<div class="row1 row">
<div id="1-4"></div>
<div id="1-3"></div>
<div id="1-2"></div>
<div id="1-1"></div>
</div>

<div class="row2 row">
<div id="2-4"></div>
<div id="2-3"></div>
<div id="2-2"></div>
<div id="2-1"></div>
</div>

<div class="row">
<div class="splitter">
<p></p>
</div>
</div>

<div class="row3 row">
<div id="3-4"></div>
<div id="3-3"></div>
<div id="3-2"></div>
<div id="3-1"></div>
</div>

<div class="row4 row">
<div id="4-4"></div>
<div id="4-3"></div>
<div id="4-2"></div>
<div id="4-1"></div>
</div>

</div>


<div id="date">
<div id="date-1" class="date-line"></div>
<div id="date-2" class="date-line"></div>
<div id="date-3" class="date-line"></div>
<div id="date-4" class="date-line"></div>
<div id="date-5" class="date-line"></div>
</div>

<div id="date-container">
<div class="left">
<p id="date1-1" class="date"></p>
<p id="date1-2" class="date selected"></p>
<p id="date1-3" class="date"></p>
</div>

<div class="right">
<p id="date2-1" class="date"></p>
<p id="date2-2" class="date selected"></p>
<p id="date2-3" class="date"></p>
</div>
</div>





<div id="day-container">
<ul>
<li id="1">Monday</li>
<li id="2">Tuesday</li>
<li id="3">Wednesday</li>
<li id="4">Thursday</li>
<li id="5">Friday</li>
<li id="6">Saturday</li>
<li id="0">Sunday</li>
</ul>
</div>







</body>



</html>



Oh and the background is suppose to be dark. - some fonts are white


Any help would be greatly appreciated. Thanks!!




Javascript widget like iphone calendar

I wonder if someone could point me to a js widget that will behave like iphone calendar in list mode. I have looked at accordion widgets but nothing is behaving in the same way, like the next day is pushing the previous one out of the screen and sticks there till the next one pushes it out.


thanks for the input




Trying to pass UIImage from one ViewController to my GameScene in spriteKit

I thought it would be interesting to learn how to pass an image from an imagePicker to my GameScene to use as a SKSpriteNode(texture: SKTexture(image: UIImage)) but i keep getting an error after selecting my image and pressing a button to go into my gameScene



override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if (segue.identifier == "startSegue") {

var gameViewController = segue.destinationViewController as GameScene

gameViewController.imageToPass = pickedImage.image

}


anyone know what im doing wrong?


keep getting exc_breakpoint (code=exc_i386_bpt, subcode 0x0) when initializing gameViewController as GameScene


I am trying to pass imageToPass to the GameScene.swift that is created when i create a new game project in Xcode


class GameScene: SKScene {



var imageToPass = UIImage()
var bird = SKSpriteNode()


override func didMoveToView(view: SKView) {
/* Setup your scene here */

var birdTexture = SKTexture(image: imageToPass)
bird = SKSpriteNode(texture: birdTexture)
bird.position = CGPoint(x: CGRectGetMidX(self.frame), y: CGRectGetMidY(self.frame))

self.addChild(bird)
}



How to delete my itunesconnect app with status "submit for review"?

I am trying to change my Bundle-ID & SKU but i came to know that its not possible.


So i decided to delete this app and create the new one with appropriate naming, still i didn't submitted anything to itunes.


But there is no option for deleting in more section.


This is my 1st experience with itunes connect. When i created my 1st project, i gave random Bundle-ID & SKU, now my app is ready and i realised that it should be something else.


any help will be great.




How to convert AVAsset to NSData or save it to file manager

I am trying to do that using AVAsset to record Audio file and then after first i store it on NSFileManager and after that by convert it to nsdata i Call API to store it.


I am successful to Create AVAsset recording file and play it using third party Class that is SCPlayer.


Now problem is that i don't know how to Use AVAsset file for save it in file manager and then after call API to sent it by converting it to NSData.


Is any way to convert AVAsset to NSData???


Please Help...




AVCaptureDevice isTorchActive always return NO

Following code doesn't work correctly:



AVCaptureDevice *flashLight = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
if ([flashLight isTorchAvailable] && [flashLight isTorchModeSupported:AVCaptureTorchModeOn])
{
BOOL success = [flashLight lockForConfiguration:nil];
if (success)
{
if ([flashLight isTorchActive])
{
//TURN ON
[flashLight setTorchMode:AVCaptureTorchModeOff];
}
else
{
//TURN OFF
[flashLight setTorchMode:AVCaptureTorchModeOn];
}
[flashLight unlockForConfiguration];
}
}


[flashLight isTorchActive] returns NO even if it's active.




Restrict Versions iOS - NO minimum version

Detail: NO is the minimum version


Is there any way I can restrict versions of iOS?


For example, I have developed an application and would like it swirled in iOS versions 7.x.x and iOS 8.1.x. In short, I would avoid the application was installed on the iOS versions 8.0.x.


How come? Currently in iOS 7 works perfectly on iOS 8.1.x also, but on iOS 8.0.x the application presents several problems, including constant crashes.




How to added font image to uilabel

I want to add font image to and UILabel.


I added new TTF file to my resource folder which is fontallo.


Added project info Fonts fontallo.ttf.


Now i want to set those images which are inside the fontallo.


Please find the below images About the font image what it do have. [lbl_FontImage setFont:[UIFont fontWithName:@"fontello" size:30]];


Unable to set those image to uiLabel, @All Need suggestion to resolve it.




Which are new Feature in Swift? [on hold]

1:



Swift is, in large part, a reimagining of the Objective-C language using modern concepts and syntax. During its introduction, it was described simply as "Objective-C without the C".



2:



Swift does not create pointers and other unsafe accessors by default, contrary to Objective-C which makes widespread use of pointers to refer to objects, as well as their traditional use in embedded C-language code, although pointers can be created explicitly.



3:



Additionally, Objective-C's use of a Smalltalk-like syntax for making method calls has been replaced with a dot-notation style and namespace system more in common with other modern languages derived from C, like Java or C#.



4:



Swift introduces true named parameters and retains key Objective-C concepts, including protocols, closures and categories, often replacing former syntax with cleaner versions and allowing these concepts to be applied to other language structures, like enums.



New Ultimate Concepts



  1. Types, variables and optionals

  2. Libraries, runtime and development

  3. Debugging and other elements

  4. Memory management




Adding search bar and display bar with core data then displaying search results on the same view

i'm trying to creating simple app that displays the device name when i try to search an item and display it on same view that contains actual data but app is crashing down. please help me. Screen Shot 2015-01-30 at 6.48.48 pm 1 Screen Shot 2015-01-30 at 6.49.10 pm




SWIFT IOS return 2 different objects in a same function

I want to return request if all went well and return error if something went wrong.



func afnwPost(url: String,client_id: String, client_secret:String,grant_type:String, userparam: String, passwordparam:String)-> AnyObject{

var parameters = ["client_id":client_id,"client_secret":client_secret,"grant_type":grant_type,"username":userparam,"password":passwordparam]

manager.POST( url,
parameters: parameters,
success: { (operation: AFHTTPRequestOperation!,responseObject: AnyObject!) in
println("JSON: " + responseObject.description)
return responseObject
},
failure: { (operation: AFHTTPRequestOperation!,error: NSError!) in
println("Error: " + error.localizedDescription)
return error
})
}


The call method



var respuesta = obtenerToken.afnwPost(host_oauth,
client_id: client_id,
client_secret:client_secret,
grant_type:grant_type_token,
userparam: textfieldUsuario.text,
passwordparam: textfieldContrasenya.text)



iOS CorePlot how to install

I am trying to use CorePlot in one of my iOS projects, but even after following the instructions and looking around online, I haven't managed to correctly install the framework. I feel like the documentation has not evolved and no longer describes the correct way to install the framework.


I followed these instructions. But some things do not make sense to me, either because they are no longer current or because I don't understand.


For instance, when I am told to add the library to the "Link binaries with binary" section, the Core Plot library is highlighted in red. Then when I am told to edit the Header Search Paths, I don't understand what to do because the .xcodeproj file I dragged into my project does not have a "framework" folder.


Could anyone please give up-to-date, noob-friendly instructions?


Thank you.




Swift animation completion bug with release build settings

There are two view controllers, Initial and modal. We have animation in the initial controller and also animation in the modal controller. Each animation have completion block. We set build scheme Run –> Build configuration to Release. Run app, go to modal controller and run the animation. After animation (in the modal controller) the completion block of animation in the Initial controller is invoked instead of the completion block in Modal controller. Is anybody also experiencing with that? Any suggestions?


Sample project here




How to add custom border to multiple UITextField?

I am working on a project which have number of text fields. All text fields should have custom border at bottom and sides. enter image description here I found this answer



CALayer *bottomBorder = [CALayer layer];
bottomBorder.frame = CGRectMake(0.0f, self.frame.size.height - 1, self.frame.size.width, 1.0f);
bottomBorder.backgroundColor = [UIColor blueColor].CGColor;
[self.textField.layer addSublayer:bottomBorder];

CALayer *leftBorder = [CALayer layer];
leftBorder.frame = CGRectMake(0.0f, self.frame.size.height -5, 1.0f, 5.0f);
leftBorder.backgroundColor = [UIColor lightGrayColor].CGColor;
[self.textField.layer addSublayer:bottomBorder];

CALayer *rightBorder = [CALayer layer];
rightBorder.frame = CGRectMake(self.frame.size.width -1, self.frame.size.height -5, 1.0f, 5.0f);
rightBorder.backgroundColor = [UIColor lightGrayColor].CGColor;
[self.textField.layer addSublayer:rightBorder];


But by using this method I need to add layer for each textField separately.


EDIT: I have achieved this by subclassing UITextField as suggested in comments.


But the borders of text fields are getting distorted as the view is scrolling. I am using auto-layout in storyboard. I have a UIScrollView(scrollView) in ViewController main view(self.view) and a UIView(contentView) within scrollView.All the TextView's are placed in contentView.


View hierarchy -



MainView
ScrollView
ContentView
TextField's



iOS openurl deep link crashes app and device

I've set up deep links to work with my app, calling back to the following function in the app delegate:



- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation;


If the app has previously been opened then you can open a link from Safari, such as:



myapp://foo/bar


It opens the app without issue and processes the link fine.


However if you kill the app (using the app switcher) and then open the same link from Safari, it will crash the app in the simulator or crash the device on an iPhone 5s running iOS 8.1.3.


But I don't understand why?


I've tried removing the application:sourceApplication:annotation: function from the app delegate, and it still crashes if the app is not running. (If it is running it opens the app fine).


Any ideas?




iOS 7 iPad Orientation issue, when view moves upside after keyboard appears on UITextField

In my application i wan't to move/animate my ViewController's view to upward direction after appearance of keyboard over UITextField.


and this must support for all orientation.i.e:

UIInterfaceOrientationPortrait

UIInterfaceOrientationPortraitUpsideDown

UIInterfaceOrientationLandscapeLeft

UIInterfaceOrientationLandscapeRight.


For UIInterfaceOrientationPortrait my code is working fine as shown below: enter image description here


But for UIInterfaceOrientationPortraitUpsideDown and UIInterfaceOrientationLandscapeLeft it is not working. please see below screenshots:


For UIInterfaceOrientationLandscapeLeft view moves towards right side instead of upward side.


enter image description here


For UIInterfaceOrientationPortraitUpsideDown view moves towards down side instead of upward side.


enter image description here


This is only issue in iOS 7. I have checked this in iOS 8, it is working fine.


I have used below code for animating UIView on keyboard appearance:



static const CGFloat KEYBOARD_ANIMATION_DURATION = 0.3;
static const CGFloat MINIMUM_SCROLL_FRACTION = 0.2;
static const CGFloat MAXIMUM_SCROLL_FRACTION = 0.8;
static const CGFloat PORTRAIT_KEYBOARD_HEIGHT = 264;
static const CGFloat LANDSCAPE_KEYBOARD_HEIGHT = 352;

-(void) textFieldDidBeginEditing:(UITextField *)textField
{
CGRect textFieldRect = [self.view.window convertRect:textField.bounds fromView:textField];

CGRect viewRect = [self.view.window convertRect:self.view.bounds fromView:self.view];

CGFloat midline = textFieldRect.origin.y + 0.5 * textFieldRect.size.height;

CGFloat numerator = midline - viewRect.origin.y - MINIMUM_SCROLL_FRACTION * viewRect.size.height;
CGFloat denominator = (MAXIMUM_SCROLL_FRACTION - MINIMUM_SCROLL_FRACTION) * viewRect.size.height;
CGFloat heightFraction = numerator / denominator;

if (heightFraction < 0.0)
{
heightFraction = 0.0;
}
else if (heightFraction > 1.0)
{
heightFraction = 1.0;
}

UIInterfaceOrientation orientation =
[[UIApplication sharedApplication] statusBarOrientation];
if (orientation == UIInterfaceOrientationPortrait ||
orientation == UIInterfaceOrientationPortraitUpsideDown)
{
animatedDistance = floor(PORTRAIT_KEYBOARD_HEIGHT * heightFraction);
}
else
{
animatedDistance = floor(LANDSCAPE_KEYBOARD_HEIGHT * heightFraction);
}

if(self.view.frame.origin.y != 0.000000)
{
self.view.frame = CGRectMake(self.view.frame.origin.x,0.0,self.view.frame.size.width,self.view.frame.size.height);
}

CGRect viewFrame = self.view.frame;
viewFrame.origin.y -= animatedDistance;

NSLog(@"View frame y pos did start: %f ",animatedDistance);

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationDuration:KEYBOARD_ANIMATION_DURATION];

[self.view setFrame:viewFrame];

[UIView commitAnimations];
}

-(void) textFieldDidEndEditing:(UITextField *)textField
{
CGRect viewFrame = self.view.frame;
viewFrame.origin.y += animatedDistance;

NSLog(@"View frame y pos did end: %f ",animatedDistance);

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationDuration:KEYBOARD_ANIMATION_DURATION];

[self.view setFrame:viewFrame];

[UIView commitAnimations];
}


Thanks




How to play live video streaming on iphone?

i want to play live video streaming on my app but i couldn't find any solution yet. Here is the URL of video stream that i want to play on my iphone app. http://ift.tt/1uIxgcl Any help please ?




Airplay unable in iPhone but screens shots are not reflect in os X application

I have Airmac application source code which running in mac system and showing airplay option in iPhone but screens does not reflect.actually I use following commands in terminal to get airplay option over iPhone device.Could any please tell me what i wrong.I'm just run following command in terminal dns-sd -R 685B3599DDE1@iosAnshtech’sMacmini _raop._tcp local 49152 "txtvers=1" "ch=2" "cn=0,1" "et=0,3" "sv=false" "da=true" "sr=44100" "ss=16" "pw=false" "vn=65537" "tp=TCP,UDP" "md=0,1,2" "vs=104.29" "am=AppleTV2,1" "sf=0x4" and get following out put Registering Service "iosAnshtech’sMacmini"._airplay._tcp.local port 7000 TXT \"srcvers=150.33\" \"model=AppleTV3,1\" \"features=0x100029FF\" \"deviceid=68:5B:35:99:DD:E1\" DATE: ---Fri 30 Jan 2015--- 15:33:07.139 ...STARTING... 15:33:08.307 Got a reply for service "iosAnshtech’sMacmini"._airplay._tcp.local.: Name now registered and active http://ift.tt/15OHj9m http://ift.tt/pWfw87




Duplicate symbol error in Xcode Build

duplicate symbol _OBJC_IVAR_$_MainPageScreenCollectionReusableView._mainPageScreenHeaderLabel in: /Users/bharathbalaraj/Library/Developer/Xcode/DerivedData/SentientiOS-anuolaqayswdbzakppukvtjatylz/Build/Intermediates/SentientiOS.build/Debug-iphonesimulator/SentientiOS.build/Objects-normal/x86_64/MainPageScreenCollectionReusableView-9480B7CE5B075E6A.o duplicate symbol _OBJC_METACLASS_$_MainPageScreenCollectionReusableView in: /Users/bharathbalaraj/Library/Developer/Xcode/DerivedData/SentientiOS-anuolaqayswdbzakppukvtjatylz/Build/Intermediates/SentientiOS.build/Debug-iphonesimulator/SentientiOS.build/Objects-normal/x86_64/MainPageScreenCollectionReusableView-9480B7CE5B075E6A.o duplicate symbol _OBJC_CLASS_$_MainPageScreenCollectionReusableView in: /Users/bharathbalaraj/Library/Developer/Xcode/DerivedData/SentientiOS-anuolaqayswdbzakppukvtjatylz/Build/Intermediates/SentientiOS.build/Debug-iphonesimulator/SentientiOS.build/Objects-normal/x86_64/MainPageScreenCollectionReusableView-9480B7CE5B075E6A.o ld: 3 duplicate symbols for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) .. i am getting this error when i compile in xcode . not sure how this is coming




iphone location service alert call back allow and don't allow handling

I have a button in which on click I am authorizing my app to enable location services. I want to capture the allow button event from the alert. As the user press allow, my button color will change to some other color. I am unable to capture the callback of allow button. However I am able to capture don't allow button event with help of this link


Location service IOS alert call back


Please can anyone tell me how to capture the allow button tap and on success I want to do my code.